From 19be19abd283ae844d2c4aca225625bcb69fdc3c Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:27:02 +0800 Subject: [PATCH] migrate DevTestLabs to autorest.powershell --- .../Generated/ArmTemplatesOperations.cs | 357 ++-- .../ArmTemplatesOperationsExtensions.cs | 259 ++- .../Generated/ArtifactSourcesOperations.cs | 716 ++++--- .../ArtifactSourcesOperationsExtensions.cs | 464 +++-- .../Generated/ArtifactsOperations.cs | 487 ++--- .../ArtifactsOperationsExtensions.cs | 354 ++-- .../Generated/CostsOperations.cs | 278 +-- .../Generated/CostsOperationsExtensions.cs | 179 +- .../Generated/CustomImagesOperations.cs | 613 +++--- .../CustomImagesOperationsExtensions.cs | 543 +++--- .../Generated/DevTestLabsClient.cs | 293 ++- .../Generated/DisksOperations.cs | 886 +++++---- .../Generated/DisksOperationsExtensions.cs | 987 +++++----- .../Generated/EnvironmentsOperations.cs | 622 +++--- .../EnvironmentsOperationsExtensions.cs | 619 +++--- .../Generated/FormulasOperations.cs | 600 +++--- .../Generated/FormulasOperationsExtensions.cs | 472 +++-- .../Generated/GalleryImagesOperations.cs | 234 +-- .../GalleryImagesOperationsExtensions.cs | 150 +- .../Generated/GlobalSchedulesOperations.cs | 1125 ++++++----- .../GlobalSchedulesOperationsExtensions.cs | 782 ++++---- .../Generated/IArmTemplatesOperations.cs | 53 +- .../Generated/IArtifactSourcesOperations.cs | 80 +- .../Generated/IArtifactsOperations.cs | 67 +- .../Generated/ICostsOperations.cs | 37 +- .../Generated/ICustomImagesOperations.cs | 98 +- .../Generated/IDevTestLabsClient.cs | 92 +- .../Generated/IDisksOperations.cs | 154 +- .../Generated/IEnvironmentsOperations.cs | 98 +- .../Generated/IFormulasOperations.cs | 96 +- .../Generated/IGalleryImagesOperations.cs | 41 +- .../Generated/IGlobalSchedulesOperations.cs | 141 +- .../Generated/ILabsOperations.cs | 234 +-- .../INotificationChannelsOperations.cs | 89 +- .../Generated/IOperations.cs | 25 +- .../Generated/IPoliciesOperations.cs | 80 +- .../Generated/IPolicySetsOperations.cs | 25 +- .../Generated/IProviderOperations.cs | 34 +- .../Generated/ISchedulesOperations.cs | 115 +- .../Generated/ISecretsOperations.cs | 70 +- .../Generated/IServiceRunnersOperations.cs | 68 +- .../Generated/IUsersOperations.cs | 88 +- .../IVirtualMachineSchedulesOperations.cs | 97 +- .../Generated/IVirtualMachinesOperations.cs | 282 +-- .../Generated/IVirtualNetworksOperations.cs | 114 +- .../Generated/LabsOperations.cs | 1579 ++++++++------- .../Generated/LabsOperationsExtensions.cs | 1337 ++++++------- .../Generated/Models/ApplicableSchedule.cs | 77 +- .../Models/ApplicableScheduleFragment.cs | 77 +- .../Models/ApplicableScheduleProperties.cs | 62 + .../ApplicableSchedulePropertiesFragment.cs | 62 + .../Generated/Models/ApplyArtifactsRequest.cs | 29 +- .../Generated/Models/ArmTemplate.cs | 121 +- .../Generated/Models/ArmTemplateInfo.cs | 38 +- .../Models/ArmTemplateParameterProperties.cs | 41 +- .../Generated/Models/ArmTemplateProperties.cs | 110 ++ .../Generated/Models/Artifact.cs | 137 +- .../ArtifactDeploymentStatusProperties.cs | 58 +- ...ifactDeploymentStatusPropertiesFragment.cs | 58 +- .../Models/ArtifactInstallProperties.cs | 88 +- .../ArtifactInstallPropertiesFragment.cs | 94 +- .../Models/ArtifactParameterProperties.cs | 41 +- .../ArtifactParameterPropertiesFragment.cs | 41 +- .../Generated/Models/ArtifactProperties.cs | 118 ++ .../Generated/Models/ArtifactSource.cs | 186 +- .../Models/ArtifactSourceFragment.cs | 173 +- .../Models/ArtifactSourceProperties.cs | 149 ++ .../ArtifactSourcePropertiesFragment.cs | 139 ++ .../Generated/Models/AttachDiskProperties.cs | 32 +- .../Models/AttachNewDataDiskOptions.cs | 51 +- .../Models/BulkCreationParameters.cs | 26 +- .../Generated/Models/ComputeDataDisk.cs | 65 +- .../Models/ComputeDataDiskFragment.cs | 65 +- .../Models/ComputeVmInstanceViewStatus.cs | 59 +- .../ComputeVmInstanceViewStatusFragment.cs | 59 +- .../Generated/Models/ComputeVmProperties.cs | 109 +- .../Models/ComputeVmPropertiesFragment.cs | 115 +- .../Models/CostThresholdProperties.cs | 85 +- .../Generated/Models/CostThresholdStatus.cs | 13 +- .../Generated/Models/CostType.cs | 13 +- .../Generated/Models/CustomImage.cs | 147 +- .../Generated/Models/CustomImageOsType.cs | 13 +- .../Generated/Models/CustomImageProperties.cs | 137 ++ .../Models/CustomImagePropertiesCustom.cs | 65 +- .../Models/CustomImagePropertiesFromVm.cs | 55 +- .../Generated/Models/DataDiskProperties.cs | 62 +- .../Generated/Models/DayDetails.cs | 25 +- .../Generated/Models/DayDetailsFragment.cs | 25 +- .../Models/DetachDataDiskProperties.cs | 29 +- .../Generated/Models/DetachDiskProperties.cs | 31 +- .../Generated/Models/Disk.cs | 173 +- .../Generated/Models/DiskProperties.cs | 141 ++ .../Generated/Models/DtlEnvironment.cs | 120 +- .../Generated/Models/EnableStatus.cs | 13 +- .../Models/EnvironmentDeploymentProperties.cs | 49 +- .../Generated/Models/EnvironmentProperties.cs | 102 + .../Models/EvaluatePoliciesProperties.cs | 45 +- .../Models/EvaluatePoliciesRequest.cs | 29 +- .../Models/EvaluatePoliciesResponse.cs | 29 +- .../Generated/Models/EventFragment.cs | 33 +- .../Generated/Models/EventModel.cs | 33 +- .../Models/ExportResourceUsageParameters.cs | 56 +- .../Generated/Models/ExternalSubnet.cs | 39 +- .../Models/ExternalSubnetFragment.cs | 39 +- .../Generated/Models/FileUploadOptions.cs | 13 +- .../Generated/Models/Formula.cs | 135 +- .../Generated/Models/FormulaProperties.cs | 118 ++ .../Models/FormulaPropertiesFromVm.cs | 28 +- .../Generated/Models/GalleryImage.cs | 109 +- .../Models/GalleryImageProperties.cs | 98 + .../Generated/Models/GalleryImageReference.cs | 65 +- .../Models/GalleryImageReferenceFragment.cs | 71 +- .../Models/GenerateArmTemplateRequest.cs | 68 +- .../Models/GenerateUploadUriParameter.cs | 25 +- .../Models/GenerateUploadUriResponse.cs | 25 +- .../Generated/Models/HostCachingOptions.cs | 13 +- .../Generated/Models/HourDetails.cs | 26 +- .../Generated/Models/HourDetailsFragment.cs | 26 +- .../Generated/Models/HttpStatusCode.cs | 13 +- .../Generated/Models/IdentityProperties.cs | 57 +- .../Generated/Models/InboundNatRule.cs | 66 +- .../Models/InboundNatRuleFragment.cs | 66 +- .../Generated/Models/Lab.cs | 186 +- .../Generated/Models/LabCost.cs | 151 +- .../Models/LabCostDetailsProperties.cs | 49 +- .../Generated/Models/LabCostProperties.cs | 138 ++ .../Models/LabCostSummaryProperties.cs | 26 +- .../Generated/Models/LabFragment.cs | 112 +- .../Generated/Models/LabProperties.cs | 148 ++ .../Generated/Models/LabPropertiesFragment.cs | 88 + .../Models/LabResourceCostProperties.cs | 118 +- .../Generated/Models/LabVhd.cs | 25 +- .../Generated/Models/LabVirtualMachine.cs | 440 +++-- .../LabVirtualMachineCreationParameter.cs | 479 ++--- ...rtualMachineCreationParameterProperties.cs | 357 ++++ .../Models/LabVirtualMachineFragment.cs | 418 ++-- .../Models/LabVirtualMachineProperties.cs | 357 ++++ .../LabVirtualMachinePropertiesFragment.cs | 347 ++++ .../Generated/Models/LinuxOsInfo.cs | 35 +- .../Generated/Models/LinuxOsState.cs | 13 +- .../Models/NetworkInterfaceProperties.cs | 132 +- .../NetworkInterfacePropertiesFragment.cs | 138 +- .../Generated/Models/NotificationChannel.cs | 113 +- .../Models/NotificationChannelEventType.cs | 13 +- .../Models/NotificationChannelFragment.cs | 108 +- .../Models/NotificationChannelProperties.cs | 98 + .../NotificationChannelPropertiesFragment.cs | 88 + .../Generated/Models/NotificationSettings.cs | 60 +- .../Models/NotificationSettingsFragment.cs | 66 +- .../Generated/Models/NotificationStatus.cs | 13 +- .../Generated/Models/NotifyParameters.cs | 40 +- .../Generated/Models/OperationError.cs | 36 +- .../Generated/Models/OperationMetadata.cs | 37 +- .../Models/OperationMetadataDisplay.cs | 61 +- .../Generated/Models/OperationResult.cs | 83 +- .../Generated/Models/Page.cs | 74 +- .../Generated/Models/ParameterInfo.cs | 37 +- .../Models/ParametersValueFileInfo.cs | 35 +- .../PercentageCostThresholdProperties.cs | 31 +- .../Generated/Models/Policy.cs | 171 +- .../Generated/Models/PolicyEvaluatorType.cs | 13 +- .../Generated/Models/PolicyFactName.cs | 13 +- .../Generated/Models/PolicyFragment.cs | 161 +- .../Generated/Models/PolicyProperties.cs | 136 ++ .../Models/PolicyPropertiesFragment.cs | 126 ++ .../Generated/Models/PolicySetResult.cs | 46 +- .../Generated/Models/PolicyStatus.cs | 13 +- .../Generated/Models/PolicyViolation.cs | 35 +- .../Generated/Models/Port.cs | 40 +- .../Generated/Models/PortFragment.cs | 40 +- .../Generated/Models/PremiumDataDisk.cs | 13 +- .../Generated/Models/ReportingCycleType.cs | 13 +- .../Generated/Models/Resource.cs | 73 +- .../Models/RetargetScheduleProperties.cs | 46 +- .../Generated/Models/Schedule.cs | 191 +- .../Generated/Models/ScheduleFragment.cs | 176 +- .../Generated/Models/ScheduleProperties.cs | 155 ++ .../Models/SchedulePropertiesFragment.cs | 145 ++ .../Generated/Models/Secret.cs | 78 +- .../Generated/Models/SecretProperties.cs | 68 + .../Generated/Models/ServiceRunner.cs | 51 +- .../SharedPublicIpAddressConfiguration.cs | 35 +- ...redPublicIpAddressConfigurationFragment.cs | 35 +- .../Models/ShutdownNotificationContent.cs | 137 +- .../Generated/Models/SourceControlType.cs | 13 +- .../Generated/Models/StorageType.cs | 13 +- .../Generated/Models/Subnet.cs | 56 +- .../Generated/Models/SubnetFragment.cs | 56 +- .../Generated/Models/SubnetOverride.cs | 100 +- .../Models/SubnetOverrideFragment.cs | 100 +- ...ubnetSharedPublicIpAddressConfiguration.cs | 40 +- ...redPublicIpAddressConfigurationFragment.cs | 40 +- .../Generated/Models/TargetCostProperties.cs | 88 +- .../Generated/Models/TargetCostStatus.cs | 13 +- .../Generated/Models/TransportProtocol.cs | 13 +- .../Generated/Models/UsagePermissionType.cs | 13 +- .../Generated/Models/User.cs | 98 +- .../Generated/Models/UserFragment.cs | 87 +- .../Generated/Models/UserIdentity.cs | 96 +- .../Generated/Models/UserIdentityFragment.cs | 96 +- .../Generated/Models/UserProperties.cs | 88 + .../Models/UserPropertiesFragment.cs | 78 + .../Generated/Models/UserSecretStore.cs | 41 +- .../Models/UserSecretStoreFragment.cs | 41 +- .../Models/VirtualMachineCreationSource.cs | 13 +- .../Generated/Models/VirtualNetwork.cs | 137 +- .../Models/VirtualNetworkFragment.cs | 126 +- .../Models/VirtualNetworkProperties.cs | 119 ++ .../VirtualNetworkPropertiesFragment.cs | 109 ++ .../Generated/Models/WeekDetails.cs | 46 +- .../Generated/Models/WeekDetailsFragment.cs | 46 +- .../Generated/Models/WindowsOsInfo.cs | 35 +- .../Generated/Models/WindowsOsState.cs | 13 +- .../NotificationChannelsOperations.cs | 835 ++++---- ...otificationChannelsOperationsExtensions.cs | 541 +++--- .../Generated/Operations.cs | 135 +- .../Generated/OperationsExtensions.cs | 88 +- .../Generated/PoliciesOperations.cs | 731 +++---- .../Generated/PoliciesOperationsExtensions.cs | 524 +++-- .../Generated/PolicySetsOperations.cs | 155 +- .../PolicySetsOperationsExtensions.cs | 94 +- .../Generated/ProviderOperations.cs | 203 +- .../Generated/ProviderOperationsExtensions.cs | 125 +- .../Generated/SchedulesOperations.cs | 1027 +++++----- .../SchedulesOperationsExtensions.cs | 740 ++++---- .../Generated/SdkInfo_DevTestLabsClient.cs | 49 - .../Generated/SecretsOperations.cs | 602 +++--- .../Generated/SecretsOperationsExtensions.cs | 433 ++--- .../Generated/ServiceRunnersOperations.cs | 587 +++--- .../ServiceRunnersOperationsExtensions.cs | 373 ++-- .../Generated/UsersOperations.cs | 726 +++---- .../Generated/UsersOperationsExtensions.cs | 535 +++--- .../VirtualMachineSchedulesOperations.cs | 850 +++++---- ...ualMachineSchedulesOperationsExtensions.cs | 690 ++++--- .../Generated/VirtualMachinesOperations.cs | 1585 +++++++++------- .../VirtualMachinesOperationsExtensions.cs | 1689 ++++++++--------- .../Generated/VirtualNetworksOperations.cs | 736 +++---- .../VirtualNetworksOperationsExtensions.cs | 622 +++--- .../DevTestLabs.Management.Sdk/README.md | 6 +- src/DevTestLabs/DevTestLabs.sln | 1 - 240 files changed, 24749 insertions(+), 19824 deletions(-) create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedulePropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourcePropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DiskProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabPropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameterProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachinePropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelPropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyPropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SchedulePropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SecretProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserPropertiesFragment.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkProperties.cs create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFragment.cs delete mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SdkInfo_DevTestLabsClient.cs diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs index 2c6ee783ea9d..62e80ed87c18 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// ArmTemplatesOperations operations. /// - internal partial class ArmTemplatesOperations : IServiceOperations, IArmTemplatesOperations + internal partial class ArmTemplatesOperations : Microsoft.Rest.IServiceOperations, IArmTemplatesOperations { /// /// Initializes a new instance of the ArmTemplatesOperations class. @@ -37,13 +24,13 @@ internal partial class ArmTemplatesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ArmTemplatesOperations(DevTestLabsClient client) + internal ArmTemplatesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal ArmTemplatesOperations(DevTestLabsClient client) /// /// List azure resource manager templates in a given artifact source. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the artifact source. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal ArmTemplatesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (artifactSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSourceName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); + + 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _armTemplate = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_armTemplate)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_armTemplate); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal ArmTemplatesOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal ArmTemplatesOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal ArmTemplatesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get azure resource manager template. /// @@ -277,7 +283,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client) /// The name of the azure Resource Manager template. /// /// - /// Specify the $expand query. Example: 'properties($select=displayName)' + /// Specify the $expand query. Example: 'properties($select=displayName)' /// /// /// Headers that will be added to request. @@ -285,13 +291,13 @@ internal ArmTemplatesOperations(DevTestLabsClient 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 /// /// @@ -300,87 +306,101 @@ internal ArmTemplatesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (artifactSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSourceName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -392,55 +412,56 @@ internal ArmTemplatesOperations(DevTestLabsClient 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); } + 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) @@ -450,9 +471,10 @@ internal ArmTemplatesOperations(DevTestLabsClient 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(); @@ -463,25 +485,29 @@ internal ArmTemplatesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List azure resource manager templates in a given artifact source. /// @@ -494,13 +520,13 @@ internal ArmTemplatesOperations(DevTestLabsClient 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 /// /// @@ -509,51 +535,54 @@ internal ArmTemplatesOperations(DevTestLabsClient 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) @@ -565,55 +594,56 @@ internal ArmTemplatesOperations(DevTestLabsClient 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); } + 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) @@ -623,9 +653,10 @@ internal ArmTemplatesOperations(DevTestLabsClient 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(); @@ -636,24 +667,28 @@ internal ArmTemplatesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs index bd53c1415237..60f209d3956a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs @@ -1,158 +1,145 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ArmTemplatesOperations. + /// Extension methods for ArmTemplatesOperations /// public static partial class ArmTemplatesOperationsExtensions { - /// - /// List azure resource manager templates in a given artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IArmTemplatesOperations operations, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, artifactSourceName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List azure resource manager templates in a given artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IArmTemplatesOperations operations, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, artifactSourceName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List azure resource manager templates in a given artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + public static Microsoft.Rest.Azure.IPage List(this IArmTemplatesOperations operations, string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IArmTemplatesOperations)operations).ListAsync(labName, artifactSourceName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get azure resource manager template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The name of the azure Resource Manager template. - /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// - public static ArmTemplate Get(this IArmTemplatesOperations operations, string labName, string artifactSourceName, string name, string expand = default(string)) + /// + /// List azure resource manager templates in a given artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IArmTemplatesOperations operations, string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, artifactSourceName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, artifactSourceName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get azure resource manager template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The name of the azure Resource Manager template. + /// + /// + /// Specify the $expand query. Example: 'properties($select=displayName)' + /// + public static ArmTemplate Get(this IArmTemplatesOperations operations, string labName, string artifactSourceName, string name, string expand = default(string)) + { + return ((IArmTemplatesOperations)operations).GetAsync(labName, artifactSourceName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get azure resource manager template. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The name of the azure Resource Manager template. - /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IArmTemplatesOperations operations, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get azure resource manager template. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The name of the azure Resource Manager template. + /// + /// + /// Specify the $expand query. Example: 'properties($select=displayName)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IArmTemplatesOperations operations, string labName, string artifactSourceName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List azure resource manager templates in a given artifact source. + /// + /// + /// 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 IArmTemplatesOperations operations, string nextPageLink) + { + return ((IArmTemplatesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List azure resource manager templates in a given artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IArmTemplatesOperations operations, string nextPageLink) + /// + /// List azure resource manager templates in a given artifact source. + /// + /// + /// 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 IArmTemplatesOperations 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; } - - /// - /// List azure resource manager templates in a given artifact source. - /// - /// - /// 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 IArmTemplatesOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperations.cs index af90c5cb9973..c73819554573 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// ArtifactSourcesOperations operations. /// - internal partial class ArtifactSourcesOperations : IServiceOperations, IArtifactSourcesOperations + internal partial class ArtifactSourcesOperations : Microsoft.Rest.IServiceOperations, IArtifactSourcesOperations { /// /// Initializes a new instance of the ArtifactSourcesOperations class. @@ -37,13 +24,13 @@ internal partial class ArtifactSourcesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ArtifactSourcesOperations(DevTestLabsClient client) + internal ArtifactSourcesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// List artifact sources in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/artifactsources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _artifactSource = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_artifactSource)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_artifactSource); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get artifact source. /// @@ -265,7 +270,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// The name of the artifact source. /// /// - /// Specify the $expand query. Example: 'properties($select=displayName)' + /// Specify the $expand query. Example: 'properties($select=displayName)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/artifactsources/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing artifact source. /// @@ -482,13 +506,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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 /// /// @@ -497,81 +521,94 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ArtifactSource artifactSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ArtifactSource artifactSource, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (artifactSource == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSource"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (artifactSource == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("artifactSource", artifactSource); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/artifactsources/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -583,61 +620,62 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(artifactSource != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(artifactSource, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(artifactSource, 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); } + 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) @@ -647,9 +685,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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(); @@ -660,16 +699,16 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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 @@ -678,25 +717,29 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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 artifact source. /// @@ -712,10 +755,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -724,76 +767,88 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/artifactsources/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -805,55 +860,56 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -863,20 +919,25 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Modify properties of artifact sources. /// @@ -895,13 +956,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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 /// /// @@ -910,81 +971,93 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string name, ArtifactSourceFragment artifactSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, ArtifactSourceFragment artifactSource, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (artifactSource == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSource"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (artifactSource == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("artifactSource", artifactSource); + 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.DevTestLab/labs/{labName}/artifactsources/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -996,61 +1069,62 @@ internal ArtifactSourcesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(artifactSource != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(artifactSource, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(artifactSource, 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); } + 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) @@ -1060,9 +1134,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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(); @@ -1073,25 +1148,29 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List artifact sources in a given lab. /// @@ -1104,13 +1183,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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 /// /// @@ -1119,51 +1198,54 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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) @@ -1175,55 +1257,56 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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); } + 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) @@ -1233,9 +1316,10 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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(); @@ -1246,24 +1330,28 @@ internal ArtifactSourcesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs index b8ca51615f84..dbdb07eb7027 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs @@ -1,275 +1,247 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ArtifactSourcesOperations. + /// Extension methods for ArtifactSourcesOperations /// public static partial class ArtifactSourcesOperationsExtensions { - /// - /// List artifact sources in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IArtifactSourcesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List artifact sources in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IArtifactSourcesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List artifact sources in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IArtifactSourcesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IArtifactSourcesOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// - public static ArtifactSource Get(this IArtifactSourcesOperations operations, string labName, string name, string expand = default(string)) + /// + /// List artifact sources in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IArtifactSourcesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// Specify the $expand query. Example: 'properties($select=displayName)' + /// + public static ArtifactSource Get(this IArtifactSourcesOperations operations, string labName, string name, string expand = default(string)) + { + return ((IArtifactSourcesOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// Specify the $expand query. Example: 'properties($select=displayName)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IArtifactSourcesOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// Specify the $expand query. Example: 'properties($select=displayName)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IArtifactSourcesOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or replace an existing artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + public static ArtifactSource CreateOrUpdate(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSource artifactSource) + { + return ((IArtifactSourcesOperations)operations).CreateOrUpdateAsync(labName, name, artifactSource).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// Properties of an artifact source. - /// - public static ArtifactSource CreateOrUpdate(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSource artifactSource) + /// + /// Create or replace an existing artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSource artifactSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, artifactSource, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, name, artifactSource).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + public static void Delete(this IArtifactSourcesOperations operations, string labName, string name) + { + ((IArtifactSourcesOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// Properties of an artifact source. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSource artifactSource, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, artifactSource, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - public static void Delete(this IArtifactSourcesOperations operations, string labName, string name) - { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); - } + /// + /// Delete artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IArtifactSourcesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of artifact sources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + public static ArtifactSource Update(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSourceFragment artifactSource) + { + return ((IArtifactSourcesOperations)operations).UpdateAsync(labName, name, artifactSource).GetAwaiter().GetResult(); + } - /// - /// Delete artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IArtifactSourcesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of artifact sources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSourceFragment artifactSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, artifactSource, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// List artifact sources in a given lab. + /// + /// + /// 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 IArtifactSourcesOperations operations, string nextPageLink) + { + return ((IArtifactSourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Modify properties of artifact sources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// Properties of an artifact source. - /// - public static ArtifactSource Update(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSourceFragment artifactSource) + /// + /// List artifact sources in a given lab. + /// + /// + /// 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 IArtifactSourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(labName, name, artifactSource).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Modify properties of artifact sources. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// Properties of an artifact source. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IArtifactSourcesOperations operations, string labName, string name, ArtifactSourceFragment artifactSource, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, artifactSource, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List artifact sources in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IArtifactSourcesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List artifact sources in a given lab. - /// - /// - /// 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 IArtifactSourcesOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperations.cs index 8ff9a806f6c5..917843baaf73 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// ArtifactsOperations operations. /// - internal partial class ArtifactsOperations : IServiceOperations, IArtifactsOperations + internal partial class ArtifactsOperations : Microsoft.Rest.IServiceOperations, IArtifactsOperations { /// /// Initializes a new instance of the ArtifactsOperations class. @@ -37,13 +24,13 @@ internal partial class ArtifactsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ArtifactsOperations(DevTestLabsClient client) + internal ArtifactsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal ArtifactsOperations(DevTestLabsClient client) /// /// List artifacts in a given artifact source. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the artifact source. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal ArtifactsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (artifactSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSourceName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); + + 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _artifact = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_artifact)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_artifact); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal ArtifactsOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal ArtifactsOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal ArtifactsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get artifact. /// @@ -277,7 +283,7 @@ internal ArtifactsOperations(DevTestLabsClient client) /// The name of the artifact. /// /// - /// Specify the $expand query. Example: 'properties($select=title)' + /// Specify the $expand query. Example: 'properties($select=title)' /// /// /// Headers that will be added to request. @@ -285,13 +291,13 @@ internal ArtifactsOperations(DevTestLabsClient 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 /// /// @@ -300,87 +306,101 @@ internal ArtifactsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (artifactSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSourceName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -392,55 +412,56 @@ internal ArtifactsOperations(DevTestLabsClient 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); } + 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) @@ -450,9 +471,10 @@ internal ArtifactsOperations(DevTestLabsClient 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(); @@ -463,25 +485,29 @@ internal ArtifactsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Generates an ARM template for the given artifact, uploads the required /// files to a storage account, and validates the generated artifact. @@ -504,13 +530,13 @@ internal ArtifactsOperations(DevTestLabsClient 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 /// /// @@ -519,87 +545,101 @@ internal ArtifactsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GenerateArmTemplateWithHttpMessagesAsync(string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GenerateArmTemplateWithHttpMessagesAsync(string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (generateArmTemplateRequest == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "generateArmTemplateRequest"); + } + + 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (artifactSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactSourceName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (generateArmTemplateRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "generateArmTemplateRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("artifactSourceName", artifactSourceName); tracingParameters.Add("name", name); + tracingParameters.Add("generateArmTemplateRequest", generateArmTemplateRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateArmTemplate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GenerateArmTemplate", 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}/generateArmTemplate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -611,61 +651,62 @@ internal ArtifactsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(generateArmTemplateRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateArmTemplateRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(generateArmTemplateRequest, 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); } + 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) @@ -675,9 +716,10 @@ internal ArtifactsOperations(DevTestLabsClient 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(); @@ -688,25 +730,29 @@ internal ArtifactsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List artifacts in a given artifact source. /// @@ -719,13 +765,13 @@ internal ArtifactsOperations(DevTestLabsClient 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 /// /// @@ -734,51 +780,54 @@ internal ArtifactsOperations(DevTestLabsClient 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) @@ -790,55 +839,56 @@ internal ArtifactsOperations(DevTestLabsClient 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); } + 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) @@ -848,9 +898,10 @@ internal ArtifactsOperations(DevTestLabsClient 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(); @@ -861,24 +912,28 @@ internal ArtifactsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs index 4f66a52b6113..f20f0c577fae 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs @@ -1,212 +1,192 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ArtifactsOperations. + /// Extension methods for ArtifactsOperations /// public static partial class ArtifactsOperationsExtensions { - /// - /// List artifacts in a given artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IArtifactsOperations operations, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, artifactSourceName, odataQuery).GetAwaiter().GetResult(); - } + /// + /// List artifacts in a given artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + public static Microsoft.Rest.Azure.IPage List(this IArtifactsOperations operations, string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IArtifactsOperations)operations).ListAsync(labName, artifactSourceName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// List artifacts in a given artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IArtifactsOperations operations, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List artifacts in a given artifact source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IArtifactsOperations operations, string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, artifactSourceName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, artifactSourceName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get artifact. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The name of the artifact. + /// + /// + /// Specify the $expand query. Example: 'properties($select=title)' + /// + public static Artifact Get(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, string expand = default(string)) + { + return ((IArtifactsOperations)operations).GetAsync(labName, artifactSourceName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get artifact. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The name of the artifact. - /// - /// - /// Specify the $expand query. Example: 'properties($select=title)' - /// - public static Artifact Get(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, string expand = default(string)) + /// + /// Get artifact. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The name of the artifact. + /// + /// + /// Specify the $expand query. Example: 'properties($select=title)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, artifactSourceName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Generates an ARM template for the given artifact, uploads the required + /// files to a storage account, and validates the generated artifact. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The name of the artifact. + /// + public static ArmTemplateInfo GenerateArmTemplate(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest) + { + return ((IArtifactsOperations)operations).GenerateArmTemplateAsync(labName, artifactSourceName, name, generateArmTemplateRequest).GetAwaiter().GetResult(); + } - /// - /// Get artifact. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The name of the artifact. - /// - /// - /// Specify the $expand query. Example: 'properties($select=title)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Generates an ARM template for the given artifact, uploads the required + /// files to a storage account, and validates the generated artifact. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the artifact source. + /// + /// + /// The name of the artifact. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateArmTemplateAsync(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GenerateArmTemplateWithHttpMessagesAsync(labName, artifactSourceName, name, generateArmTemplateRequest, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List artifacts in a given artifact source. + /// + /// + /// 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 IArtifactsOperations operations, string nextPageLink) + { + return ((IArtifactsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Generates an ARM template for the given artifact, uploads the required - /// files to a storage account, and validates the generated artifact. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The name of the artifact. - /// - /// - /// Parameters for generating an ARM template for deploying artifacts. - /// - public static ArmTemplateInfo GenerateArmTemplate(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest) + /// + /// List artifacts in a given artifact source. + /// + /// + /// 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 IArtifactsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.GenerateArmTemplateAsync(labName, artifactSourceName, name, generateArmTemplateRequest).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Generates an ARM template for the given artifact, uploads the required - /// files to a storage account, and validates the generated artifact. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the artifact source. - /// - /// - /// The name of the artifact. - /// - /// - /// Parameters for generating an ARM template for deploying artifacts. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateArmTemplateAsync(this IArtifactsOperations operations, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateArmTemplateWithHttpMessagesAsync(labName, artifactSourceName, name, generateArmTemplateRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List artifacts in a given artifact source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IArtifactsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List artifacts in a given artifact source. - /// - /// - /// 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 IArtifactsOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperations.cs index 11e3ff7bbbf4..be53e319f202 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperations.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.DevTestLabs { + 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; /// /// CostsOperations operations. /// - internal partial class CostsOperations : IServiceOperations, ICostsOperations + internal partial class CostsOperations : Microsoft.Rest.IServiceOperations, ICostsOperations { /// /// Initializes a new instance of the CostsOperations class. @@ -36,13 +24,13 @@ internal partial class CostsOperations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal CostsOperations(DevTestLabsClient client) + internal CostsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,7 +48,7 @@ internal CostsOperations(DevTestLabsClient client) /// The name of the cost. /// /// - /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' + /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' /// /// /// Headers that will be added to request. @@ -68,13 +56,13 @@ internal CostsOperations(DevTestLabsClient 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,81 +71,94 @@ internal CostsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/costs/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -169,55 +170,56 @@ internal CostsOperations(DevTestLabsClient 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); } + 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) @@ -227,9 +229,10 @@ internal CostsOperations(DevTestLabsClient 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(); @@ -240,25 +243,29 @@ internal CostsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing cost. /// @@ -277,13 +284,13 @@ internal CostsOperations(DevTestLabsClient 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 /// /// @@ -292,81 +299,94 @@ internal CostsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabCost labCost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabCost labCost, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (labCost == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labCost"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (labCost == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labCost"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("labCost", labCost); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/costs/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -378,61 +398,62 @@ internal CostsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(labCost != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(labCost, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(labCost, 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); } + 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) @@ -442,9 +463,10 @@ internal CostsOperations(DevTestLabsClient 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(); @@ -455,16 +477,16 @@ internal CostsOperations(DevTestLabsClient 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 @@ -473,24 +495,28 @@ internal CostsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs index 080159be0bae..2f72402025ab 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs @@ -1,117 +1,100 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CostsOperations. + /// Extension methods for CostsOperations /// public static partial class CostsOperationsExtensions { - /// - /// Get cost. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the cost. - /// - /// - /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' - /// - public static LabCost Get(this ICostsOperations operations, string labName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); - } + /// + /// Get cost. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the cost. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' + /// + public static LabCost Get(this ICostsOperations operations, string labName, string name, string expand = default(string)) + { + return ((ICostsOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get cost. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the cost. - /// - /// - /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICostsOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get cost. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the cost. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICostsOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or replace an existing cost. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the cost. + /// + public static LabCost CreateOrUpdate(this ICostsOperations operations, string labName, string name, LabCost labCost) + { + return ((ICostsOperations)operations).CreateOrUpdateAsync(labName, name, labCost).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing cost. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the cost. - /// - /// - /// A cost item. - /// - public static LabCost CreateOrUpdate(this ICostsOperations operations, string labName, string name, LabCost labCost) + /// + /// Create or replace an existing cost. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the cost. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICostsOperations operations, string labName, string name, LabCost labCost, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, labCost, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, name, labCost).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Create or replace an existing cost. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the cost. - /// - /// - /// A cost item. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ICostsOperations operations, string labName, string name, LabCost labCost, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, labCost, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperations.cs index 7ffc23ae1faa..7dd972eb8d56 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// CustomImagesOperations operations. /// - internal partial class CustomImagesOperations : IServiceOperations, ICustomImagesOperations + internal partial class CustomImagesOperations : Microsoft.Rest.IServiceOperations, ICustomImagesOperations { /// /// Initializes a new instance of the CustomImagesOperations class. @@ -37,13 +24,13 @@ internal partial class CustomImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CustomImagesOperations(DevTestLabsClient client) + internal CustomImagesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// List custom images in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/customimages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _customImage = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_customImage)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_customImage); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal CustomImagesOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal CustomImagesOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal CustomImagesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get custom image. /// @@ -265,7 +270,7 @@ internal CustomImagesOperations(DevTestLabsClient client) /// The name of the custom image. /// /// - /// Specify the $expand query. Example: 'properties($select=vm)' + /// Specify the $expand query. Example: 'properties($select=vm)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal CustomImagesOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/customimages/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal CustomImagesOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal CustomImagesOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal CustomImagesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing custom image. This operation can take a while /// to complete. @@ -478,16 +502,16 @@ internal CustomImagesOperations(DevTestLabsClient client) /// A custom image. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, customImage, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, customImage, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -500,16 +524,16 @@ internal CustomImagesOperations(DevTestLabsClient client) /// The name of the custom image. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -531,13 +555,13 @@ internal CustomImagesOperations(DevTestLabsClient 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 /// /// @@ -546,85 +570,97 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (customImage == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "customImage"); } - if (Client.ResourceGroupName == null) + if (customImage != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + customImage.Validate(); } - if (labName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (customImage == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "customImage"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (customImage != null) + + if (name == null) { - customImage.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("customImage", customImage); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{labName}/customimages/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -636,61 +672,62 @@ internal CustomImagesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(customImage != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customImage, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(customImage, 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); } + 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) @@ -700,9 +737,10 @@ internal CustomImagesOperations(DevTestLabsClient 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(); @@ -713,16 +751,16 @@ internal CustomImagesOperations(DevTestLabsClient 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 @@ -731,25 +769,29 @@ internal CustomImagesOperations(DevTestLabsClient 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 custom image. This operation can take a while to complete. /// @@ -765,10 +807,10 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -777,76 +819,88 @@ internal CustomImagesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + 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.DevTestLab/labs/{labName}/customimages/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -858,55 +912,56 @@ internal CustomImagesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -916,20 +971,25 @@ internal CustomImagesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List custom images in a given lab. /// @@ -942,13 +1002,13 @@ internal CustomImagesOperations(DevTestLabsClient 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 /// /// @@ -957,51 +1017,54 @@ internal CustomImagesOperations(DevTestLabsClient 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) @@ -1013,55 +1076,56 @@ internal CustomImagesOperations(DevTestLabsClient 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); } + 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) @@ -1071,9 +1135,10 @@ internal CustomImagesOperations(DevTestLabsClient 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(); @@ -1084,24 +1149,28 @@ internal CustomImagesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs index 67bb34be3d47..191912f05c85 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs @@ -1,316 +1,287 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CustomImagesOperations. + /// Extension methods for CustomImagesOperations /// public static partial class CustomImagesOperationsExtensions { - /// - /// List custom images in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this ICustomImagesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List custom images in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICustomImagesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get custom image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// Specify the $expand query. Example: 'properties($select=vm)' - /// - public static CustomImage Get(this ICustomImagesOperations operations, string labName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get custom image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// Specify the $expand query. Example: 'properties($select=vm)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICustomImagesOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing custom image. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// A custom image. - /// - public static CustomImage CreateOrUpdate(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage) - { - return operations.CreateOrUpdateAsync(labName, name, customImage).GetAwaiter().GetResult(); - } + /// + /// List custom images in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this ICustomImagesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((ICustomImagesOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing custom image. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// A custom image. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List custom images in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ICustomImagesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, customImage, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get custom image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + /// + /// Specify the $expand query. Example: 'properties($select=vm)' + /// + public static CustomImage Get(this ICustomImagesOperations operations, string labName, string name, string expand = default(string)) + { + return ((ICustomImagesOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Delete custom image. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - public static void Delete(this ICustomImagesOperations operations, string labName, string name) + /// + /// Get custom image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + /// + /// Specify the $expand query. Example: 'properties($select=vm)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICustomImagesOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing custom image. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + public static CustomImage CreateOrUpdate(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage) + { + return ((ICustomImagesOperations)operations).CreateOrUpdateAsync(labName, name, customImage).GetAwaiter().GetResult(); + } - /// - /// Delete custom image. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICustomImagesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing custom image. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, customImage, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete custom image. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + public static void Delete(this ICustomImagesOperations operations, string labName, string name) + { + ((ICustomImagesOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing custom image. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// A custom image. - /// - public static CustomImage BeginCreateOrUpdate(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage) - { - return operations.BeginCreateOrUpdateAsync(labName, name, customImage).GetAwaiter().GetResult(); - } + /// + /// Delete custom image. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ICustomImagesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or replace an existing custom image. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + public static CustomImage BeginCreateOrUpdate(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage) + { + return ((ICustomImagesOperations)operations).BeginCreateOrUpdateAsync(labName, name, customImage).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing custom image. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// A custom image. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing custom image. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ICustomImagesOperations operations, string labName, string name, CustomImage customImage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, customImage, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, customImage, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete custom image. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + public static void BeginDelete(this ICustomImagesOperations operations, string labName, string name) + { + ((ICustomImagesOperations)operations).BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Delete custom image. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - public static void BeginDelete(this ICustomImagesOperations operations, string labName, string name) - { - operations.BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); - } + /// + /// Delete custom image. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the custom image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICustomImagesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List custom images in a given lab. + /// + /// + /// 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 ICustomImagesOperations operations, string nextPageLink) + { + return ((ICustomImagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete custom image. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the custom image. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ICustomImagesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List custom images in a given lab. + /// + /// + /// 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 ICustomImagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// List custom images in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICustomImagesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List custom images in a given lab. - /// - /// - /// 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 ICustomImagesOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DevTestLabsClient.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DevTestLabsClient.cs index 89e5e662c07f..85a2515694f5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DevTestLabsClient.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DevTestLabsClient.cs @@ -1,199 +1,162 @@ -// // 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.DevTestLabs { + 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; /// /// The DevTest Labs Client. /// - public partial class DevTestLabsClient : ServiceClient, IDevTestLabsClient, IAzureClient + public partial class DevTestLabsClient : Microsoft.Rest.ServiceClient, IDevTestLabsClient, 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; } /// - /// Client API version. + /// The API version to use for this operation. /// public string ApiVersion { get; private set; } /// /// The name of the resource group. /// - public string ResourceGroupName { get; set; } + public string ResourceGroupName { get; set;} /// /// The subscription ID. /// - public string SubscriptionId { get; 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 IProviderOperations. + /// Gets the IProviderOperations /// public virtual IProviderOperations ProviderOperations { get; private set; } - /// - /// Gets the ILabsOperations. + /// Gets the ILabsOperations /// public virtual ILabsOperations Labs { get; private set; } - /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IGlobalSchedulesOperations. + /// Gets the IGlobalSchedulesOperations /// public virtual IGlobalSchedulesOperations GlobalSchedules { get; private set; } - /// - /// Gets the IArtifactSourcesOperations. + /// Gets the IArtifactSourcesOperations /// public virtual IArtifactSourcesOperations ArtifactSources { get; private set; } - /// - /// Gets the IArmTemplatesOperations. + /// Gets the IArmTemplatesOperations /// public virtual IArmTemplatesOperations ArmTemplates { get; private set; } - /// - /// Gets the IArtifactsOperations. + /// Gets the IArtifactsOperations /// public virtual IArtifactsOperations Artifacts { get; private set; } - /// - /// Gets the ICostsOperations. + /// Gets the ICostsOperations /// public virtual ICostsOperations Costs { get; private set; } - /// - /// Gets the ICustomImagesOperations. + /// Gets the ICustomImagesOperations /// public virtual ICustomImagesOperations CustomImages { get; private set; } - /// - /// Gets the IFormulasOperations. + /// Gets the IFormulasOperations /// public virtual IFormulasOperations Formulas { get; private set; } - /// - /// Gets the IGalleryImagesOperations. + /// Gets the IGalleryImagesOperations /// public virtual IGalleryImagesOperations GalleryImages { get; private set; } - /// - /// Gets the INotificationChannelsOperations. + /// Gets the INotificationChannelsOperations /// public virtual INotificationChannelsOperations NotificationChannels { get; private set; } - /// - /// Gets the IPolicySetsOperations. + /// Gets the IPolicySetsOperations /// public virtual IPolicySetsOperations PolicySets { get; private set; } - /// - /// Gets the IPoliciesOperations. + /// Gets the IPoliciesOperations /// public virtual IPoliciesOperations Policies { get; private set; } - /// - /// Gets the ISchedulesOperations. + /// Gets the ISchedulesOperations /// public virtual ISchedulesOperations Schedules { get; private set; } - /// - /// Gets the IServiceRunnersOperations. + /// Gets the IServiceRunnersOperations /// public virtual IServiceRunnersOperations ServiceRunners { get; private set; } - /// - /// Gets the IUsersOperations. + /// Gets the IUsersOperations /// public virtual IUsersOperations Users { get; private set; } - /// - /// Gets the IDisksOperations. + /// Gets the IDisksOperations /// public virtual IDisksOperations Disks { get; private set; } - /// - /// Gets the IEnvironmentsOperations. + /// Gets the IEnvironmentsOperations /// public virtual IEnvironmentsOperations Environments { get; private set; } - /// - /// Gets the ISecretsOperations. + /// Gets the ISecretsOperations /// public virtual ISecretsOperations Secrets { get; private set; } - /// - /// Gets the IVirtualMachinesOperations. + /// Gets the IVirtualMachinesOperations /// public virtual IVirtualMachinesOperations VirtualMachines { get; private set; } - /// - /// Gets the IVirtualMachineSchedulesOperations. + /// Gets the IVirtualMachineSchedulesOperations /// public virtual IVirtualMachineSchedulesOperations VirtualMachineSchedules { get; private set; } - /// - /// Gets the IVirtualNetworksOperations. + /// Gets the IVirtualNetworksOperations /// public virtual IVirtualNetworksOperations VirtualNetworks { get; private set; } - /// /// Initializes a new instance of the DevTestLabsClient class. /// @@ -202,24 +165,22 @@ public partial class DevTestLabsClient : ServiceClient, IDevT /// /// /// True: will dispose the provided httpClient on calling DevTestLabsClient.Dispose(). False: will not dispose provided httpClient - protected DevTestLabsClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected DevTestLabsClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the DevTestLabsClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected DevTestLabsClient(params DelegatingHandler[] handlers) : base(handlers) + protected DevTestLabsClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the DevTestLabsClient class. + /// Initializes a new instance of the DevTestLabsClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -227,11 +188,10 @@ protected DevTestLabsClient(params DelegatingHandler[] handlers) : base(handlers /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected DevTestLabsClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected DevTestLabsClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the DevTestLabsClient class. /// @@ -244,15 +204,14 @@ protected DevTestLabsClient(HttpClientHandler rootHandler, params DelegatingHand /// /// Thrown when a required parameter is null /// - protected DevTestLabsClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected DevTestLabsClient(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 DevTestLabsClient class. /// @@ -268,15 +227,15 @@ protected DevTestLabsClient(System.Uri baseUri, params DelegatingHandler[] handl /// /// Thrown when a required parameter is null /// - protected DevTestLabsClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected DevTestLabsClient(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 DevTestLabsClient class. /// @@ -289,23 +248,23 @@ protected DevTestLabsClient(System.Uri baseUri, HttpClientHandler rootHandler, p /// /// Thrown when a required parameter is null /// - public DevTestLabsClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DevTestLabsClient(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 DevTestLabsClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -316,23 +275,23 @@ public DevTestLabsClient(ServiceClientCredentials credentials, params Delegating /// /// Thrown when a required parameter is null /// - public DevTestLabsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public DevTestLabsClient(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 DevTestLabsClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -344,26 +303,26 @@ public DevTestLabsClient(ServiceClientCredentials credentials, HttpClient httpCl /// /// Thrown when a required parameter is null /// - public DevTestLabsClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DevTestLabsClient(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 DevTestLabsClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -372,7 +331,7 @@ public DevTestLabsClient(ServiceClientCredentials credentials, HttpClientHandler /// /// Thrown when a required parameter is null /// - public DevTestLabsClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DevTestLabsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -382,33 +341,30 @@ public DevTestLabsClient(System.Uri baseUri, ServiceClientCredentials credential { 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 DevTestLabsClient 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 DevTestLabsClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DevTestLabsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -418,80 +374,81 @@ public DevTestLabsClient(System.Uri baseUri, ServiceClientCredentials credential { 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() { - ProviderOperations = new ProviderOperations(this); - Labs = new LabsOperations(this); - Operations = new Operations(this); - GlobalSchedules = new GlobalSchedulesOperations(this); - ArtifactSources = new ArtifactSourcesOperations(this); - ArmTemplates = new ArmTemplatesOperations(this); - Artifacts = new ArtifactsOperations(this); - Costs = new CostsOperations(this); - CustomImages = new CustomImagesOperations(this); - Formulas = new FormulasOperations(this); - GalleryImages = new GalleryImagesOperations(this); - NotificationChannels = new NotificationChannelsOperations(this); - PolicySets = new PolicySetsOperations(this); - Policies = new PoliciesOperations(this); - Schedules = new SchedulesOperations(this); - ServiceRunners = new ServiceRunnersOperations(this); - Users = new UsersOperations(this); - Disks = new DisksOperations(this); - Environments = new EnvironmentsOperations(this); - Secrets = new SecretsOperations(this); - VirtualMachines = new VirtualMachinesOperations(this); - VirtualMachineSchedules = new VirtualMachineSchedulesOperations(this); - VirtualNetworks = new VirtualNetworksOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2016-05-15"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.ProviderOperations = new ProviderOperations(this); + this.Labs = new LabsOperations(this); + this.Operations = new Operations(this); + this.GlobalSchedules = new GlobalSchedulesOperations(this); + this.ArtifactSources = new ArtifactSourcesOperations(this); + this.ArmTemplates = new ArmTemplatesOperations(this); + this.Artifacts = new ArtifactsOperations(this); + this.Costs = new CostsOperations(this); + this.CustomImages = new CustomImagesOperations(this); + this.Formulas = new FormulasOperations(this); + this.GalleryImages = new GalleryImagesOperations(this); + this.NotificationChannels = new NotificationChannelsOperations(this); + this.PolicySets = new PolicySetsOperations(this); + this.Policies = new PoliciesOperations(this); + this.Schedules = new SchedulesOperations(this); + this.ServiceRunners = new ServiceRunnersOperations(this); + this.Users = new UsersOperations(this); + this.Disks = new DisksOperations(this); + this.Environments = new EnvironmentsOperations(this); + this.Secrets = new SecretsOperations(this); + this.VirtualMachines = new VirtualMachinesOperations(this); + this.VirtualMachineSchedules = new VirtualMachineSchedulesOperations(this); + this.VirtualNetworks = new VirtualNetworksOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2016-05-15"; + 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs index 77c93b98bc40..e5d7ac49a4a0 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// DisksOperations operations. /// - internal partial class DisksOperations : IServiceOperations, IDisksOperations + internal partial class DisksOperations : Microsoft.Rest.IServiceOperations, IDisksOperations { /// /// Initializes a new instance of the DisksOperations class. @@ -37,13 +24,13 @@ internal partial class DisksOperations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal DisksOperations(DevTestLabsClient client) + internal DisksOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal DisksOperations(DevTestLabsClient client) /// /// List disks in a given user profile. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the user profile. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("userName", userName); + + 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.DevTestLab/labs/{labName}/users/{userName}/disks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _disk = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_disk)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_disk); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal DisksOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal DisksOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal DisksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get disk. /// @@ -277,7 +283,7 @@ internal DisksOperations(DevTestLabsClient client) /// The name of the disk. /// /// - /// Specify the $expand query. Example: 'properties($select=diskType)' + /// Specify the $expand query. Example: 'properties($select=diskType)' /// /// /// Headers that will be added to request. @@ -285,13 +291,13 @@ internal DisksOperations(DevTestLabsClient 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 /// /// @@ -300,87 +306,101 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -392,55 +412,56 @@ internal DisksOperations(DevTestLabsClient 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); } + 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) @@ -450,9 +471,10 @@ internal DisksOperations(DevTestLabsClient 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(); @@ -463,25 +485,29 @@ internal DisksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing disk. This operation can take a while to /// complete. @@ -499,16 +525,16 @@ internal DisksOperations(DevTestLabsClient client) /// A Disk. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, disk, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, disk, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -524,16 +550,16 @@ internal DisksOperations(DevTestLabsClient client) /// The name of the disk. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, userName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, userName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -553,16 +579,16 @@ internal DisksOperations(DevTestLabsClient client) /// Properties of the disk to attach. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task AttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task AttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginAttachWithHttpMessagesAsync(labName, userName, name, attachDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginAttachWithHttpMessagesAsync(labName, userName, name, attachDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -582,16 +608,16 @@ internal DisksOperations(DevTestLabsClient client) /// Properties of the disk to detach. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDetachWithHttpMessagesAsync(labName, userName, name, detachDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDetachWithHttpMessagesAsync(labName, userName, name, detachDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -616,13 +642,13 @@ internal DisksOperations(DevTestLabsClient 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 /// /// @@ -631,87 +657,101 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (disk == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "disk"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + if (this.Client.ResourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - if (disk == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "disk"); - } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + tracingParameters.Add("disk", disk); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -723,61 +763,62 @@ internal DisksOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(disk != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(disk, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(disk, 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); } + 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) @@ -787,9 +828,10 @@ internal DisksOperations(DevTestLabsClient 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(); @@ -800,16 +842,16 @@ internal DisksOperations(DevTestLabsClient 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 @@ -818,25 +860,29 @@ internal DisksOperations(DevTestLabsClient 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 disk. This operation can take a while to complete. /// @@ -855,10 +901,10 @@ internal DisksOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -867,82 +913,95 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + + 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -954,55 +1013,56 @@ internal DisksOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -1012,20 +1072,25 @@ internal DisksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Attach and create the lease of the disk to the virtual machine. This /// operation can take a while to complete. @@ -1048,10 +1113,10 @@ internal DisksOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1060,87 +1125,101 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginAttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginAttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (attachDiskProperties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "attachDiskProperties"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (attachDiskProperties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "attachDiskProperties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + tracingParameters.Add("attachDiskProperties", attachDiskProperties); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAttach", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAttach", 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/attach").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1152,61 +1231,62 @@ internal DisksOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(attachDiskProperties != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(attachDiskProperties, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(attachDiskProperties, 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); } + 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) @@ -1216,20 +1296,25 @@ internal DisksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Detach and break the lease of the disk attached to the virtual machine. /// This operation can take a while to complete. @@ -1252,10 +1337,10 @@ internal DisksOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1264,87 +1349,101 @@ internal DisksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (detachDiskProperties == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "detachDiskProperties"); + } + + 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (detachDiskProperties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "detachDiskProperties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + tracingParameters.Add("detachDiskProperties", detachDiskProperties); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDetach", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDetach", 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/detach").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1356,61 +1455,62 @@ internal DisksOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(detachDiskProperties != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(detachDiskProperties, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(detachDiskProperties, 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); } + 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) @@ -1420,20 +1520,25 @@ internal DisksOperations(DevTestLabsClient 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; - } + + + + + } /// /// List disks in a given user profile. /// @@ -1446,13 +1551,13 @@ internal DisksOperations(DevTestLabsClient 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 /// /// @@ -1461,51 +1566,54 @@ internal DisksOperations(DevTestLabsClient 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) @@ -1517,55 +1625,56 @@ internal DisksOperations(DevTestLabsClient 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); } + 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) @@ -1575,9 +1684,10 @@ internal DisksOperations(DevTestLabsClient 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(); @@ -1588,24 +1698,28 @@ internal DisksOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperationsExtensions.cs index 84553486368a..5e53fc8e1d97 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperationsExtensions.cs @@ -1,556 +1,499 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DisksOperations. + /// Extension methods for DisksOperations /// public static partial class DisksOperationsExtensions { - /// - /// List disks in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IDisksOperations operations, string labName, string userName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, userName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List disks in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDisksOperations operations, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Specify the $expand query. Example: 'properties($select=diskType)' - /// - public static Disk Get(this IDisksOperations operations, string labName, string userName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, userName, name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Specify the $expand query. Example: 'properties($select=diskType)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDisksOperations operations, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing disk. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// A Disk. - /// - public static Disk CreateOrUpdate(this IDisksOperations operations, string labName, string userName, string name, Disk disk) - { - return operations.CreateOrUpdateAsync(labName, userName, name, disk).GetAwaiter().GetResult(); - } - - /// - /// Create or replace an existing disk. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// A Disk. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDisksOperations operations, string labName, string userName, string name, Disk disk, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, userName, name, disk, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete disk. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - public static void Delete(this IDisksOperations operations, string labName, string userName, string name) - { - operations.DeleteAsync(labName, userName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete disk. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDisksOperations operations, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// List disks in a given user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static Microsoft.Rest.Azure.IPage List(this IDisksOperations operations, string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IDisksOperations)operations).ListAsync(labName, userName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Attach and create the lease of the disk to the virtual machine. This - /// operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to attach. - /// - public static void Attach(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties) + /// + /// List disks in a given user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDisksOperations operations, string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - operations.AttachAsync(labName, userName, name, attachDiskProperties).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// Specify the $expand query. Example: 'properties($select=diskType)' + /// + public static Disk Get(this IDisksOperations operations, string labName, string userName, string name, string expand = default(string)) + { + return ((IDisksOperations)operations).GetAsync(labName, userName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Attach and create the lease of the disk to the virtual machine. This - /// operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to attach. - /// - /// - /// The cancellation token. - /// - public static async Task AttachAsync(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// Specify the $expand query. Example: 'properties($select=diskType)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDisksOperations operations, string labName, string userName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.AttachWithHttpMessagesAsync(labName, userName, name, attachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create or replace an existing disk. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static Disk CreateOrUpdate(this IDisksOperations operations, string labName, string userName, string name, Disk disk) + { + return ((IDisksOperations)operations).CreateOrUpdateAsync(labName, userName, name, disk).GetAwaiter().GetResult(); + } - /// - /// Detach and break the lease of the disk attached to the virtual machine. - /// This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to detach. - /// - public static void Detach(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties) + /// + /// Create or replace an existing disk. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDisksOperations operations, string labName, string userName, string name, Disk disk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, userName, name, disk, null, cancellationToken).ConfigureAwait(false)) { - operations.DetachAsync(labName, userName, name, detachDiskProperties).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete disk. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static void Delete(this IDisksOperations operations, string labName, string userName, string name) + { + ((IDisksOperations)operations).DeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + } - /// - /// Detach and break the lease of the disk attached to the virtual machine. - /// This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to detach. - /// - /// - /// The cancellation token. - /// - public static async Task DetachAsync(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DetachWithHttpMessagesAsync(labName, userName, name, detachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete disk. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDisksOperations operations, string labName, string userName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static void Attach(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties) + { + ((IDisksOperations)operations).AttachAsync(labName, userName, name, attachDiskProperties).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing disk. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// A Disk. - /// - public static Disk BeginCreateOrUpdate(this IDisksOperations operations, string labName, string userName, string name, Disk disk) - { - return operations.BeginCreateOrUpdateAsync(labName, userName, name, disk).GetAwaiter().GetResult(); - } + /// + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AttachAsync(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.AttachWithHttpMessagesAsync(labName, userName, name, attachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static void Detach(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties) + { + ((IDisksOperations)operations).DetachAsync(labName, userName, name, detachDiskProperties).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing disk. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// A Disk. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDisksOperations operations, string labName, string userName, string name, Disk disk, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, disk, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DetachAsync(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DetachWithHttpMessagesAsync(labName, userName, name, detachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or replace an existing disk. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static Disk BeginCreateOrUpdate(this IDisksOperations operations, string labName, string userName, string name, Disk disk) + { + return ((IDisksOperations)operations).BeginCreateOrUpdateAsync(labName, userName, name, disk).GetAwaiter().GetResult(); + } - /// - /// Delete disk. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - public static void BeginDelete(this IDisksOperations operations, string labName, string userName, string name) + /// + /// Create or replace an existing disk. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDisksOperations operations, string labName, string userName, string name, Disk disk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, disk, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete disk. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static void BeginDelete(this IDisksOperations operations, string labName, string userName, string name) + { + ((IDisksOperations)operations).BeginDeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + } - /// - /// Delete disk. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDisksOperations operations, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete disk. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDisksOperations operations, string labName, string userName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static void BeginAttach(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties) + { + ((IDisksOperations)operations).BeginAttachAsync(labName, userName, name, attachDiskProperties).GetAwaiter().GetResult(); + } - /// - /// Attach and create the lease of the disk to the virtual machine. This - /// operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to attach. - /// - public static void BeginAttach(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties) - { - operations.BeginAttachAsync(labName, userName, name, attachDiskProperties).GetAwaiter().GetResult(); - } + /// + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAttachAsync(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginAttachWithHttpMessagesAsync(labName, userName, name, attachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + public static void BeginDetach(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties) + { + ((IDisksOperations)operations).BeginDetachAsync(labName, userName, name, detachDiskProperties).GetAwaiter().GetResult(); + } - /// - /// Attach and create the lease of the disk to the virtual machine. This - /// operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to attach. - /// - /// - /// The cancellation token. - /// - public static async Task BeginAttachAsync(this IDisksOperations operations, string labName, string userName, string name, AttachDiskProperties attachDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginAttachWithHttpMessagesAsync(labName, userName, name, attachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Detach and break the lease of the disk attached to the virtual machine. - /// This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to detach. - /// - public static void BeginDetach(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties) - { - operations.BeginDetachAsync(labName, userName, name, detachDiskProperties).GetAwaiter().GetResult(); - } + /// + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the disk. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDetachAsync(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDetachWithHttpMessagesAsync(labName, userName, name, detachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List disks in a given user profile. + /// + /// + /// 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 IDisksOperations operations, string nextPageLink) + { + return ((IDisksOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Detach and break the lease of the disk attached to the virtual machine. - /// This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the disk. - /// - /// - /// Properties of the disk to detach. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDetachAsync(this IDisksOperations operations, string labName, string userName, string name, DetachDiskProperties detachDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List disks in a given user profile. + /// + /// + /// 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 IDisksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDetachWithHttpMessagesAsync(labName, userName, name, detachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// List disks in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDisksOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List disks in a given user profile. - /// - /// - /// 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 IDisksOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperations.cs index 1aad7b39f920..49c78070be08 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// EnvironmentsOperations operations. /// - internal partial class EnvironmentsOperations : IServiceOperations, IEnvironmentsOperations + internal partial class EnvironmentsOperations : Microsoft.Rest.IServiceOperations, IEnvironmentsOperations { /// /// Initializes a new instance of the EnvironmentsOperations class. @@ -37,13 +24,13 @@ internal partial class EnvironmentsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EnvironmentsOperations(DevTestLabsClient client) + internal EnvironmentsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// List environments in a given user profile. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the user profile. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("userName", userName); + + 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.DevTestLab/labs/{labName}/users/{userName}/environments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _dtlEnvironment = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_dtlEnvironment)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_dtlEnvironment); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal EnvironmentsOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal EnvironmentsOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal EnvironmentsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get environment. /// @@ -278,7 +284,7 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' + /// 'properties($select=deploymentProperties)' /// /// /// Headers that will be added to request. @@ -286,13 +292,13 @@ internal EnvironmentsOperations(DevTestLabsClient 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 /// /// @@ -301,87 +307,101 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/users/{userName}/environments/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -393,55 +413,56 @@ internal EnvironmentsOperations(DevTestLabsClient 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); } + 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) @@ -451,9 +472,10 @@ internal EnvironmentsOperations(DevTestLabsClient 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(); @@ -464,25 +486,29 @@ internal EnvironmentsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing environment. This operation can take a while /// to complete. @@ -500,16 +526,16 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// An environment, which is essentially an ARM template deployment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, dtlEnvironment, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, dtlEnvironment, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -525,16 +551,16 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// The name of the environment. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, userName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, userName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -559,13 +585,13 @@ internal EnvironmentsOperations(DevTestLabsClient 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 /// /// @@ -574,87 +600,101 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (dtlEnvironment == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dtlEnvironment"); + } + + 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (dtlEnvironment == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dtlEnvironment"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + tracingParameters.Add("dtlEnvironment", dtlEnvironment); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{labName}/users/{userName}/environments/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -666,61 +706,62 @@ internal EnvironmentsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(dtlEnvironment != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dtlEnvironment, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dtlEnvironment, 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); } + 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) @@ -730,9 +771,10 @@ internal EnvironmentsOperations(DevTestLabsClient 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(); @@ -743,16 +785,16 @@ internal EnvironmentsOperations(DevTestLabsClient 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 @@ -761,25 +803,29 @@ internal EnvironmentsOperations(DevTestLabsClient 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 environment. This operation can take a while to complete. /// @@ -798,10 +844,10 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -810,82 +856,95 @@ internal EnvironmentsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + + 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.DevTestLab/labs/{labName}/users/{userName}/environments/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -897,55 +956,56 @@ internal EnvironmentsOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -955,20 +1015,25 @@ internal EnvironmentsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List environments in a given user profile. /// @@ -981,13 +1046,13 @@ internal EnvironmentsOperations(DevTestLabsClient 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 /// /// @@ -996,51 +1061,54 @@ internal EnvironmentsOperations(DevTestLabsClient 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) @@ -1052,55 +1120,56 @@ internal EnvironmentsOperations(DevTestLabsClient 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); } + 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) @@ -1110,9 +1179,10 @@ internal EnvironmentsOperations(DevTestLabsClient 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(); @@ -1123,24 +1193,28 @@ internal EnvironmentsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperationsExtensions.cs index ac5a514d6717..b45d7342d619 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperationsExtensions.cs @@ -1,354 +1,325 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for EnvironmentsOperations. + /// Extension methods for EnvironmentsOperations /// public static partial class EnvironmentsOperationsExtensions { - /// - /// List environments in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IEnvironmentsOperations operations, string labName, string userName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, userName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List environments in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IEnvironmentsOperations operations, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get environment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' - /// - public static DtlEnvironment Get(this IEnvironmentsOperations operations, string labName, string userName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, userName, name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get environment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing environment. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// An environment, which is essentially an ARM template deployment. - /// - public static DtlEnvironment CreateOrUpdate(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment) - { - return operations.CreateOrUpdateAsync(labName, userName, name, dtlEnvironment).GetAwaiter().GetResult(); - } + /// + /// List environments in a given user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static Microsoft.Rest.Azure.IPage List(this IEnvironmentsOperations operations, string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IEnvironmentsOperations)operations).ListAsync(labName, userName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing environment. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// An environment, which is essentially an ARM template deployment. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List environments in a given user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IEnvironmentsOperations operations, string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + /// + /// Specify the $expand query. Example: + /// 'properties($select=deploymentProperties)' + /// + public static DtlEnvironment Get(this IEnvironmentsOperations operations, string labName, string userName, string name, string expand = default(string)) + { + return ((IEnvironmentsOperations)operations).GetAsync(labName, userName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Delete environment. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - public static void Delete(this IEnvironmentsOperations operations, string labName, string userName, string name) + /// + /// Get environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + /// + /// Specify the $expand query. Example: + /// 'properties($select=deploymentProperties)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing environment. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + public static DtlEnvironment CreateOrUpdate(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment) + { + return ((IEnvironmentsOperations)operations).CreateOrUpdateAsync(labName, userName, name, dtlEnvironment).GetAwaiter().GetResult(); + } - /// - /// Delete environment. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing environment. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete environment. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + public static void Delete(this IEnvironmentsOperations operations, string labName, string userName, string name) + { + ((IEnvironmentsOperations)operations).DeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing environment. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// An environment, which is essentially an ARM template deployment. - /// - public static DtlEnvironment BeginCreateOrUpdate(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment) - { - return operations.BeginCreateOrUpdateAsync(labName, userName, name, dtlEnvironment).GetAwaiter().GetResult(); - } + /// + /// Delete environment. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or replace an existing environment. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + public static DtlEnvironment BeginCreateOrUpdate(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment) + { + return ((IEnvironmentsOperations)operations).BeginCreateOrUpdateAsync(labName, userName, name, dtlEnvironment).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing environment. This operation can take a while - /// to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// An environment, which is essentially an ARM template deployment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing environment. This operation can take a while + /// to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, DtlEnvironment dtlEnvironment, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete environment. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + public static void BeginDelete(this IEnvironmentsOperations operations, string labName, string userName, string name) + { + ((IEnvironmentsOperations)operations).BeginDeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + } - /// - /// Delete environment. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - public static void BeginDelete(this IEnvironmentsOperations operations, string labName, string userName, string name) - { - operations.BeginDeleteAsync(labName, userName, name).GetAwaiter().GetResult(); - } + /// + /// Delete environment. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the environment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List environments in a given user profile. + /// + /// + /// 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 IEnvironmentsOperations operations, string nextPageLink) + { + return ((IEnvironmentsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete environment. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the environment. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IEnvironmentsOperations operations, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List environments in a given user profile. + /// + /// + /// 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 IEnvironmentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// List environments in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IEnvironmentsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List environments in a given user profile. - /// - /// - /// 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 IEnvironmentsOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperations.cs index 686196b0e236..4905e26b3efe 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// FormulasOperations operations. /// - internal partial class FormulasOperations : IServiceOperations, IFormulasOperations + internal partial class FormulasOperations : Microsoft.Rest.IServiceOperations, IFormulasOperations { /// /// Initializes a new instance of the FormulasOperations class. @@ -37,13 +24,13 @@ internal partial class FormulasOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal FormulasOperations(DevTestLabsClient client) + internal FormulasOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal FormulasOperations(DevTestLabsClient client) /// /// List formulas in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal FormulasOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/formulas").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _formula = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_formula)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_formula); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal FormulasOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal FormulasOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal FormulasOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get formula. /// @@ -265,7 +270,7 @@ internal FormulasOperations(DevTestLabsClient client) /// The name of the formula. /// /// - /// Specify the $expand query. Example: 'properties($select=description)' + /// Specify the $expand query. Example: 'properties($select=description)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal FormulasOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal FormulasOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/formulas/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal FormulasOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal FormulasOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal FormulasOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing Formula. This operation can take a while to /// complete. @@ -478,16 +502,16 @@ internal FormulasOperations(DevTestLabsClient client) /// A formula for creating a VM, specifying an image base and other parameters /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, formula, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, formula, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -505,10 +529,10 @@ internal FormulasOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -517,76 +541,88 @@ internal FormulasOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/formulas/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -598,55 +634,56 @@ internal FormulasOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -656,20 +693,25 @@ internal FormulasOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing Formula. This operation can take a while to /// complete. @@ -689,13 +731,13 @@ internal FormulasOperations(DevTestLabsClient 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 /// /// @@ -704,81 +746,94 @@ internal FormulasOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (formula == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "formula"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (formula == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "formula"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("formula", formula); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{labName}/formulas/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -790,61 +845,62 @@ internal FormulasOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(formula != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(formula, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(formula, 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); } + 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) @@ -854,9 +910,10 @@ internal FormulasOperations(DevTestLabsClient 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(); @@ -867,16 +924,16 @@ internal FormulasOperations(DevTestLabsClient 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 @@ -885,25 +942,29 @@ internal FormulasOperations(DevTestLabsClient 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; - } + + + + + } /// /// List formulas in a given lab. /// @@ -916,13 +977,13 @@ internal FormulasOperations(DevTestLabsClient 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 /// /// @@ -931,51 +992,54 @@ internal FormulasOperations(DevTestLabsClient 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) @@ -987,55 +1051,56 @@ internal FormulasOperations(DevTestLabsClient 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); } + 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) @@ -1045,9 +1110,10 @@ internal FormulasOperations(DevTestLabsClient 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(); @@ -1058,24 +1124,28 @@ internal FormulasOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperationsExtensions.cs index 91254b87a009..80f0ef92faba 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperationsExtensions.cs @@ -1,279 +1,251 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for FormulasOperations. + /// Extension methods for FormulasOperations /// public static partial class FormulasOperationsExtensions { - /// - /// List formulas in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IFormulasOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List formulas in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IFormulasOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List formulas in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IFormulasOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IFormulasOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get formula. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// - public static Formula Get(this IFormulasOperations operations, string labName, string name, string expand = default(string)) + /// + /// List formulas in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IFormulasOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get formula. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + /// + /// Specify the $expand query. Example: 'properties($select=description)' + /// + public static Formula Get(this IFormulasOperations operations, string labName, string name, string expand = default(string)) + { + return ((IFormulasOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get formula. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IFormulasOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get formula. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + /// + /// Specify the $expand query. Example: 'properties($select=description)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IFormulasOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or replace an existing Formula. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + public static Formula CreateOrUpdate(this IFormulasOperations operations, string labName, string name, Formula formula) + { + return ((IFormulasOperations)operations).CreateOrUpdateAsync(labName, name, formula).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing Formula. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// A formula for creating a VM, specifying an image base and other parameters - /// - public static Formula CreateOrUpdate(this IFormulasOperations operations, string labName, string name, Formula formula) + /// + /// Create or replace an existing Formula. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IFormulasOperations operations, string labName, string name, Formula formula, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, formula, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, name, formula).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete formula. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + public static void Delete(this IFormulasOperations operations, string labName, string name) + { + ((IFormulasOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing Formula. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// A formula for creating a VM, specifying an image base and other parameters - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IFormulasOperations operations, string labName, string name, Formula formula, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, formula, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete formula. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - public static void Delete(this IFormulasOperations operations, string labName, string name) - { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); - } + /// + /// Delete formula. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IFormulasOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or replace an existing Formula. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + public static Formula BeginCreateOrUpdate(this IFormulasOperations operations, string labName, string name, Formula formula) + { + return ((IFormulasOperations)operations).BeginCreateOrUpdateAsync(labName, name, formula).GetAwaiter().GetResult(); + } - /// - /// Delete formula. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IFormulasOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing Formula. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the formula. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IFormulasOperations operations, string labName, string name, Formula formula, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, formula, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// List formulas in a given lab. + /// + /// + /// 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 IFormulasOperations operations, string nextPageLink) + { + return ((IFormulasOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing Formula. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// A formula for creating a VM, specifying an image base and other parameters - /// - public static Formula BeginCreateOrUpdate(this IFormulasOperations operations, string labName, string name, Formula formula) + /// + /// List formulas in a given lab. + /// + /// + /// 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 IFormulasOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(labName, name, formula).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Create or replace an existing Formula. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the formula. - /// - /// - /// A formula for creating a VM, specifying an image base and other parameters - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IFormulasOperations operations, string labName, string name, Formula formula, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, formula, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List formulas in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IFormulasOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List formulas in a given lab. - /// - /// - /// 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 IFormulasOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperations.cs index 66ab6eaeeed4..a5650dce3df4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// GalleryImagesOperations operations. /// - internal partial class GalleryImagesOperations : IServiceOperations, IGalleryImagesOperations + internal partial class GalleryImagesOperations : Microsoft.Rest.IServiceOperations, IGalleryImagesOperations { /// /// Initializes a new instance of the GalleryImagesOperations class. @@ -37,13 +24,13 @@ internal partial class GalleryImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GalleryImagesOperations(DevTestLabsClient client) + internal GalleryImagesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal GalleryImagesOperations(DevTestLabsClient client) /// /// List gallery images in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal GalleryImagesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/galleryimages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _galleryImage = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_galleryImage)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_galleryImage); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal GalleryImagesOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal GalleryImagesOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal GalleryImagesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List gallery images in a given lab. /// @@ -267,13 +272,13 @@ internal GalleryImagesOperations(DevTestLabsClient 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 /// /// @@ -282,51 +287,54 @@ internal GalleryImagesOperations(DevTestLabsClient 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) @@ -338,55 +346,56 @@ internal GalleryImagesOperations(DevTestLabsClient 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); } + 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) @@ -396,9 +405,10 @@ internal GalleryImagesOperations(DevTestLabsClient 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(); @@ -409,24 +419,28 @@ internal GalleryImagesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs index 73dbcbe417f0..83ef513943a4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs @@ -1,100 +1,88 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryImagesOperations. + /// Extension methods for GalleryImagesOperations /// public static partial class GalleryImagesOperationsExtensions { - /// - /// List gallery images in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IGalleryImagesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } + /// + /// List gallery images in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IGalleryImagesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IGalleryImagesOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// List gallery images in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IGalleryImagesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery images in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IGalleryImagesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List gallery images in a given lab. + /// + /// + /// 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 IGalleryImagesOperations operations, string nextPageLink) + { + return ((IGalleryImagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List gallery images in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IGalleryImagesOperations operations, string nextPageLink) + /// + /// List gallery images in a given lab. + /// + /// + /// 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 IGalleryImagesOperations 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; } - - /// - /// List gallery images in a given lab. - /// - /// - /// 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 IGalleryImagesOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperations.cs index 80e2810b90a6..9b79d19eb5a6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// GlobalSchedulesOperations operations. /// - internal partial class GlobalSchedulesOperations : IServiceOperations, IGlobalSchedulesOperations + internal partial class GlobalSchedulesOperations : Microsoft.Rest.IServiceOperations, IGlobalSchedulesOperations { /// /// Initializes a new instance of the GlobalSchedulesOperations class. @@ -37,13 +24,13 @@ internal partial class GlobalSchedulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GlobalSchedulesOperations(DevTestLabsClient client) + internal GlobalSchedulesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -55,7 +42,7 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// List schedules in a subscription. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -63,13 +50,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -78,68 +65,78 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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("odataQuery", odataQuery); + + 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.DevTestLab/schedules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _schedule = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_schedule)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_schedule); } } - if (Client.ApiVersion != null) + 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) @@ -151,55 +148,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -209,9 +207,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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,30 +221,34 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List schedules in a resource group. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -253,13 +256,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -268,73 +271,84 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.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("odataQuery", odataQuery); + + 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.DevTestLab/schedules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _schedule = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_schedule)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_schedule); } } - if (Client.ApiVersion != null) + 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) @@ -346,55 +360,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -404,9 +419,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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(); @@ -417,25 +433,29 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get schedule. /// @@ -443,7 +463,7 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// Specify the $expand query. Example: 'properties($select=status)' + /// Specify the $expand query. Example: 'properties($select=status)' /// /// /// Headers that will be added to request. @@ -451,13 +471,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -466,75 +486,87 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -546,55 +578,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -604,9 +637,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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(); @@ -617,25 +651,29 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing schedule. /// @@ -651,13 +689,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -666,75 +704,87 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string name, Schedule schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string name, Schedule schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (schedule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "schedule"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (schedule == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("schedule", schedule); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -746,61 +796,62 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(schedule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, 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); } + 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) @@ -810,9 +861,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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(); @@ -823,16 +875,16 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 @@ -841,25 +893,29 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 schedule. /// @@ -872,10 +928,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -884,70 +940,81 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -959,55 +1026,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -1017,20 +1085,25 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Modify properties of schedules. /// @@ -1046,13 +1119,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -1061,75 +1134,86 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string name, ScheduleFragment schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string name, ScheduleFragment schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (schedule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "schedule"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (schedule == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("schedule", schedule); + 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.DevTestLab/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1141,61 +1225,62 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(schedule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, 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); } + 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) @@ -1205,9 +1290,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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(); @@ -1218,25 +1304,29 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Execute a schedule. This operation can take a while to complete. /// @@ -1244,20 +1334,20 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ExecuteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ExecuteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Updates a schedule's target resource Id. This operation can take a while to + /// Updates a schedule's target resource Id. This operation can take a while to /// complete. /// /// @@ -1267,16 +1357,16 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// Properties for retargeting a virtual machine schedule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRetargetWithHttpMessagesAsync(name, retargetScheduleProperties, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetargetWithHttpMessagesAsync(name, retargetScheduleProperties, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1291,10 +1381,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1303,70 +1393,81 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginExecuteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginExecuteWithHttpMessagesAsync(string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", 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.DevTestLab/schedules/{name}/execute").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1378,55 +1479,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1436,22 +1538,27 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 a schedule's target resource Id. This operation can take a while to + /// Updates a schedule's target resource Id. This operation can take a while to /// complete. /// /// @@ -1466,10 +1573,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1478,75 +1585,87 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (retargetScheduleProperties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "retargetScheduleProperties"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (retargetScheduleProperties == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "retargetScheduleProperties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("retargetScheduleProperties", retargetScheduleProperties); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRetarget", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetarget", 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.DevTestLab/schedules/{name}/retarget").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1558,61 +1677,62 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(retargetScheduleProperties != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(retargetScheduleProperties, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(retargetScheduleProperties, 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); } + 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) @@ -1622,20 +1742,25 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List schedules in a subscription. /// @@ -1648,13 +1773,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -1663,51 +1788,54 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", 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) @@ -1719,55 +1847,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1777,9 +1906,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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(); @@ -1790,25 +1920,29 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List schedules in a resource group. /// @@ -1821,13 +1955,13 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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 /// /// @@ -1836,51 +1970,54 @@ internal GlobalSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", 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) @@ -1892,55 +2029,56 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1950,9 +2088,10 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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(); @@ -1963,24 +2102,28 @@ internal GlobalSchedulesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperationsExtensions.cs index 261d7ec5590b..6bd3cd7ffd4d 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperationsExtensions.cs @@ -1,453 +1,407 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GlobalSchedulesOperations. + /// Extension methods for GlobalSchedulesOperations /// public static partial class GlobalSchedulesOperationsExtensions { - /// - /// List schedules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListBySubscription(this IGlobalSchedulesOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListBySubscriptionAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IGlobalSchedulesOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List schedules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListByResourceGroup(this IGlobalSchedulesOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListByResourceGroupAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IGlobalSchedulesOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List schedules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IGlobalSchedulesOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IGlobalSchedulesOperations)operations).ListBySubscriptionAsync(odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this IGlobalSchedulesOperations operations, string name, string expand = default(string)) + /// + /// List schedules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IGlobalSchedulesOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List schedules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IGlobalSchedulesOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IGlobalSchedulesOperations)operations).ListByResourceGroupAsync(odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGlobalSchedulesOperations operations, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List schedules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IGlobalSchedulesOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// Specify the $expand query. Example: 'properties($select=status)' + /// + public static Schedule Get(this IGlobalSchedulesOperations operations, string name, string expand = default(string)) + { + return ((IGlobalSchedulesOperations)operations).GetAsync(name, expand).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - public static Schedule CreateOrUpdate(this IGlobalSchedulesOperations operations, string name, Schedule schedule) + /// + /// Get schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// Specify the $expand query. Example: 'properties($select=status)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGlobalSchedulesOperations operations, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(name, schedule).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static Schedule CreateOrUpdate(this IGlobalSchedulesOperations operations, string name, Schedule schedule) + { + return ((IGlobalSchedulesOperations)operations).CreateOrUpdateAsync(name, schedule).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGlobalSchedulesOperations operations, string name, Schedule schedule, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGlobalSchedulesOperations operations, string name, Schedule schedule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(name, schedule, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(name, schedule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static void Delete(this IGlobalSchedulesOperations operations, string name) + { + ((IGlobalSchedulesOperations)operations).DeleteAsync(name).GetAwaiter().GetResult(); + } - /// - /// Delete schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - public static void Delete(this IGlobalSchedulesOperations operations, string name) - { - operations.DeleteAsync(name).GetAwaiter().GetResult(); - } + /// + /// Delete schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGlobalSchedulesOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of schedules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static Schedule Update(this IGlobalSchedulesOperations operations, string name, ScheduleFragment schedule) + { + return ((IGlobalSchedulesOperations)operations).UpdateAsync(name, schedule).GetAwaiter().GetResult(); + } - /// - /// Delete schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGlobalSchedulesOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of schedules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGlobalSchedulesOperations operations, string name, ScheduleFragment schedule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(name, schedule, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static void Execute(this IGlobalSchedulesOperations operations, string name) + { + ((IGlobalSchedulesOperations)operations).ExecuteAsync(name).GetAwaiter().GetResult(); + } - /// - /// Modify properties of schedules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - public static Schedule Update(this IGlobalSchedulesOperations operations, string name, ScheduleFragment schedule) - { - return operations.UpdateAsync(name, schedule).GetAwaiter().GetResult(); - } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExecuteAsync(this IGlobalSchedulesOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ExecuteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static void Retarget(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties) + { + ((IGlobalSchedulesOperations)operations).RetargetAsync(name, retargetScheduleProperties).GetAwaiter().GetResult(); + } - /// - /// Modify properties of schedules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGlobalSchedulesOperations operations, string name, ScheduleFragment schedule, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(name, schedule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RetargetAsync(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RetargetWithHttpMessagesAsync(name, retargetScheduleProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static void BeginExecute(this IGlobalSchedulesOperations operations, string name) + { + ((IGlobalSchedulesOperations)operations).BeginExecuteAsync(name).GetAwaiter().GetResult(); + } - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - public static void Execute(this IGlobalSchedulesOperations operations, string name) - { - operations.ExecuteAsync(name).GetAwaiter().GetResult(); - } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExecuteAsync(this IGlobalSchedulesOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginExecuteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + public static void BeginRetarget(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties) + { + ((IGlobalSchedulesOperations)operations).BeginRetargetAsync(name, retargetScheduleProperties).GetAwaiter().GetResult(); + } - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task ExecuteAsync(this IGlobalSchedulesOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ExecuteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRetargetAsync(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRetargetWithHttpMessagesAsync(name, retargetScheduleProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List schedules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IGlobalSchedulesOperations operations, string nextPageLink) + { + return ((IGlobalSchedulesOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Updates a schedule's target resource Id. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// Properties for retargeting a virtual machine schedule. - /// - public static void Retarget(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties) + /// + /// List schedules in a subscription. + /// + /// + /// 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> ListBySubscriptionNextAsync(this IGlobalSchedulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.RetargetAsync(name, retargetScheduleProperties).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List schedules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IGlobalSchedulesOperations operations, string nextPageLink) + { + return ((IGlobalSchedulesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Updates a schedule's target resource Id. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// Properties for retargeting a virtual machine schedule. - /// - /// - /// The cancellation token. - /// - public static async Task RetargetAsync(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List schedules in a resource group. + /// + /// + /// 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> ListByResourceGroupNextAsync(this IGlobalSchedulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.RetargetWithHttpMessagesAsync(name, retargetScheduleProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - public static void BeginExecute(this IGlobalSchedulesOperations operations, string name) - { - operations.BeginExecuteAsync(name).GetAwaiter().GetResult(); - } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginExecuteAsync(this IGlobalSchedulesOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginExecuteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a schedule's target resource Id. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// Properties for retargeting a virtual machine schedule. - /// - public static void BeginRetarget(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties) - { - operations.BeginRetargetAsync(name, retargetScheduleProperties).GetAwaiter().GetResult(); - } - - /// - /// Updates a schedule's target resource Id. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the schedule. - /// - /// - /// Properties for retargeting a virtual machine schedule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRetargetAsync(this IGlobalSchedulesOperations operations, string name, RetargetScheduleProperties retargetScheduleProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRetargetWithHttpMessagesAsync(name, retargetScheduleProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List schedules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IGlobalSchedulesOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IGlobalSchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List schedules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IGlobalSchedulesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IGlobalSchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArmTemplatesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArmTemplatesOperations.cs index eb3ccba681f2..0d3618587104 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArmTemplatesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArmTemplatesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ArmTemplatesOperations operations. @@ -27,15 +16,18 @@ public partial interface IArmTemplatesOperations /// /// List azure resource manager templates in a given artifact source. /// + /// + /// List azure resource manager templates in a given artifact source. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the artifact source. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface IArmTemplatesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get azure resource manager template. /// + /// + /// Get azure resource manager template. + /// /// /// The name of the lab. /// @@ -65,8 +58,7 @@ public partial interface IArmTemplatesOperations /// The name of the azure Resource Manager template. /// /// - /// Specify the $expand query. Example: - /// 'properties($select=displayName)' + /// Specify the $expand query. Example: 'properties($select=displayName)' /// /// /// The headers that will be added to request. @@ -80,13 +72,14 @@ public partial interface IArmTemplatesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List azure resource manager templates in a given artifact source. /// + /// + /// List azure resource manager templates in a given artifact source. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -102,9 +95,7 @@ public partial interface IArmTemplatesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactSourcesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactSourcesOperations.cs index 0a9f812ea6ef..e98369fabe1d 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactSourcesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactSourcesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ArtifactSourcesOperations operations. @@ -27,12 +16,15 @@ public partial interface IArtifactSourcesOperations /// /// List artifact sources in a given lab. /// + /// + /// List artifact sources in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IArtifactSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get artifact source. /// + /// + /// Get artifact source. + /// /// /// The name of the lab. /// @@ -59,8 +52,7 @@ public partial interface IArtifactSourcesOperations /// The name of the artifact source. /// /// - /// Specify the $expand query. Example: - /// 'properties($select=displayName)' + /// Specify the $expand query. Example: 'properties($select=displayName)' /// /// /// The headers that will be added to request. @@ -74,13 +66,14 @@ public partial interface IArtifactSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing artifact source. /// + /// + /// Create or replace an existing artifact source. + /// /// /// The name of the lab. /// @@ -102,13 +95,14 @@ public partial interface IArtifactSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ArtifactSource artifactSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ArtifactSource artifactSource, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete artifact source. /// + /// + /// Delete artifact source. + /// /// /// The name of the lab. /// @@ -124,13 +118,14 @@ public partial interface IArtifactSourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of artifact sources. /// + /// + /// Modify properties of artifact sources. + /// /// /// The name of the lab. /// @@ -152,13 +147,14 @@ public partial interface IArtifactSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string name, ArtifactSourceFragment artifactSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, ArtifactSourceFragment artifactSource, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List artifact sources in a given lab. /// + /// + /// List artifact sources in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -174,9 +170,7 @@ public partial interface IArtifactSourcesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactsOperations.cs index 4f0966887c54..1022623e393e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactsOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ArtifactsOperations operations. @@ -27,15 +16,18 @@ public partial interface IArtifactsOperations /// /// List artifacts in a given artifact source. /// + /// + /// List artifacts in a given artifact source. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the artifact source. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface IArtifactsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string artifactSourceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get artifact. /// + /// + /// Get artifact. + /// /// /// The name of the lab. /// @@ -65,7 +58,7 @@ public partial interface IArtifactsOperations /// The name of the artifact. /// /// - /// Specify the $expand query. Example: 'properties($select=title)' + /// Specify the $expand query. Example: 'properties($select=title)' /// /// /// The headers that will be added to request. @@ -79,15 +72,16 @@ public partial interface IArtifactsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string artifactSourceName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates an ARM template for the given artifact, uploads the - /// required files to a storage account, and validates the generated - /// artifact. + /// Generates an ARM template for the given artifact, uploads the required + /// files to a storage account, and validates the generated artifact. /// + /// + /// Generates an ARM template for the given artifact, uploads the required + /// files to a storage account, and validates the generated artifact. + /// /// /// The name of the lab. /// @@ -112,13 +106,14 @@ public partial interface IArtifactsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateArmTemplateWithHttpMessagesAsync(string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GenerateArmTemplateWithHttpMessagesAsync(string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List artifacts in a given artifact source. /// + /// + /// List artifacts in a given artifact source. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -134,9 +129,7 @@ public partial interface IArtifactsOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICostsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICostsOperations.cs index 322320d5d4c2..d100c77cf9a7 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICostsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICostsOperations.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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CostsOperations operations. @@ -26,6 +16,9 @@ public partial interface ICostsOperations /// /// Get cost. /// + /// + /// Get cost. + /// /// /// The name of the lab. /// @@ -33,8 +26,7 @@ public partial interface ICostsOperations /// The name of the cost. /// /// - /// Specify the $expand query. Example: - /// 'properties($expand=labCostDetails)' + /// Specify the $expand query. Example: 'properties($expand=labCostDetails)' /// /// /// The headers that will be added to request. @@ -48,13 +40,14 @@ public partial interface ICostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing cost. /// + /// + /// Create or replace an existing cost. + /// /// /// The name of the lab. /// @@ -76,9 +69,7 @@ public partial interface ICostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabCost labCost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabCost labCost, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICustomImagesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICustomImagesOperations.cs index 621ee9e7fe7a..a26a3082aedc 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICustomImagesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICustomImagesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CustomImagesOperations operations. @@ -27,12 +16,15 @@ public partial interface ICustomImagesOperations /// /// List custom images in a given lab. /// + /// + /// List custom images in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface ICustomImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get custom image. /// + /// + /// Get custom image. + /// /// /// The name of the lab. /// @@ -59,7 +52,7 @@ public partial interface ICustomImagesOperations /// The name of the custom image. /// /// - /// Specify the $expand query. Example: 'properties($select=vm)' + /// Specify the $expand query. Example: 'properties($select=vm)' /// /// /// The headers that will be added to request. @@ -73,14 +66,16 @@ public partial interface ICustomImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing custom image. This operation can take - /// a while to complete. + /// Create or replace an existing custom image. This operation can take a while + /// to complete. /// + /// + /// Create or replace an existing custom image. This operation can take a while + /// to complete. + /// /// /// The name of the lab. /// @@ -102,13 +97,14 @@ public partial interface ICustomImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete custom image. This operation can take a while to complete. /// + /// + /// Delete custom image. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -124,14 +120,16 @@ public partial interface ICustomImagesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing custom image. This operation can take - /// a while to complete. + /// Create or replace an existing custom image. This operation can take a while + /// to complete. /// + /// + /// Create or replace an existing custom image. This operation can take a while + /// to complete. + /// /// /// The name of the lab. /// @@ -153,13 +151,14 @@ public partial interface ICustomImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, CustomImage customImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete custom image. This operation can take a while to complete. /// + /// + /// Delete custom image. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -175,13 +174,14 @@ public partial interface ICustomImagesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List custom images in a given lab. /// + /// + /// List custom images in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -197,9 +197,7 @@ public partial interface ICustomImagesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDevTestLabsClient.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDevTestLabsClient.cs index 4d0c6b6f5cd4..b0200bb786c5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDevTestLabsClient.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDevTestLabsClient.cs @@ -1,24 +1,18 @@ -// // 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.DevTestLabs { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// The DevTest Labs Client. /// - public partial interface IDevTestLabsClient : System.IDisposable + public partial interface IDevTestLabsClient : System.IDisposable { /// /// The base URI of the service. @@ -28,166 +22,172 @@ public partial interface IDevTestLabsClient : 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;} + /// - /// Client API version. + /// The API version to use for this operation. /// - string ApiVersion { get; } + string ApiVersion { get;} + /// /// The name of the resource group. /// - string ResourceGroupName { get; set; } + string ResourceGroupName { get; set;} + /// /// The subscription ID. /// - string SubscriptionId { get; set; } + 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 IProviderOperations. + /// Gets the IProviderOperations /// IProviderOperations ProviderOperations { get; } /// - /// Gets the ILabsOperations. + /// Gets the ILabsOperations /// ILabsOperations Labs { get; } /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the IGlobalSchedulesOperations. + /// Gets the IGlobalSchedulesOperations /// IGlobalSchedulesOperations GlobalSchedules { get; } /// - /// Gets the IArtifactSourcesOperations. + /// Gets the IArtifactSourcesOperations /// IArtifactSourcesOperations ArtifactSources { get; } /// - /// Gets the IArmTemplatesOperations. + /// Gets the IArmTemplatesOperations /// IArmTemplatesOperations ArmTemplates { get; } /// - /// Gets the IArtifactsOperations. + /// Gets the IArtifactsOperations /// IArtifactsOperations Artifacts { get; } /// - /// Gets the ICostsOperations. + /// Gets the ICostsOperations /// ICostsOperations Costs { get; } /// - /// Gets the ICustomImagesOperations. + /// Gets the ICustomImagesOperations /// ICustomImagesOperations CustomImages { get; } /// - /// Gets the IFormulasOperations. + /// Gets the IFormulasOperations /// IFormulasOperations Formulas { get; } /// - /// Gets the IGalleryImagesOperations. + /// Gets the IGalleryImagesOperations /// IGalleryImagesOperations GalleryImages { get; } /// - /// Gets the INotificationChannelsOperations. + /// Gets the INotificationChannelsOperations /// INotificationChannelsOperations NotificationChannels { get; } /// - /// Gets the IPolicySetsOperations. + /// Gets the IPolicySetsOperations /// IPolicySetsOperations PolicySets { get; } /// - /// Gets the IPoliciesOperations. + /// Gets the IPoliciesOperations /// IPoliciesOperations Policies { get; } /// - /// Gets the ISchedulesOperations. + /// Gets the ISchedulesOperations /// ISchedulesOperations Schedules { get; } /// - /// Gets the IServiceRunnersOperations. + /// Gets the IServiceRunnersOperations /// IServiceRunnersOperations ServiceRunners { get; } /// - /// Gets the IUsersOperations. + /// Gets the IUsersOperations /// IUsersOperations Users { get; } /// - /// Gets the IDisksOperations. + /// Gets the IDisksOperations /// IDisksOperations Disks { get; } /// - /// Gets the IEnvironmentsOperations. + /// Gets the IEnvironmentsOperations /// IEnvironmentsOperations Environments { get; } /// - /// Gets the ISecretsOperations. + /// Gets the ISecretsOperations /// ISecretsOperations Secrets { get; } /// - /// Gets the IVirtualMachinesOperations. + /// Gets the IVirtualMachinesOperations /// IVirtualMachinesOperations VirtualMachines { get; } /// - /// Gets the IVirtualMachineSchedulesOperations. + /// Gets the IVirtualMachineSchedulesOperations /// IVirtualMachineSchedulesOperations VirtualMachineSchedules { get; } /// - /// Gets the IVirtualNetworksOperations. + /// Gets the IVirtualNetworksOperations /// IVirtualNetworksOperations VirtualNetworks { get; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDisksOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDisksOperations.cs index f9b433fa50dc..419fd493d6aa 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDisksOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDisksOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DisksOperations operations. @@ -27,15 +16,18 @@ public partial interface IDisksOperations /// /// List disks in a given user profile. /// + /// + /// List disks in a given user profile. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the user profile. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get disk. /// + /// + /// Get disk. + /// /// /// The name of the lab. /// @@ -65,7 +58,7 @@ public partial interface IDisksOperations /// The name of the disk. /// /// - /// Specify the $expand query. Example: 'properties($select=diskType)' + /// Specify the $expand query. Example: 'properties($select=diskType)' /// /// /// The headers that will be added to request. @@ -79,14 +72,16 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing disk. This operation can take a while - /// to complete. + /// Create or replace an existing disk. This operation can take a while to + /// complete. /// + /// + /// Create or replace an existing disk. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -111,13 +106,14 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete disk. This operation can take a while to complete. /// + /// + /// Delete disk. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -136,14 +132,16 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Attach and create the lease of the disk to the virtual machine. - /// This operation can take a while to complete. + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. /// + /// + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -165,14 +163,16 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task AttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task AttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Detach and break the lease of the disk attached to the virtual - /// machine. This operation can take a while to complete. + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. /// + /// + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -194,14 +194,16 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing disk. This operation can take a while - /// to complete. + /// Create or replace an existing disk. This operation can take a while to + /// complete. /// + /// + /// Create or replace an existing disk. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -226,13 +228,14 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete disk. This operation can take a while to complete. /// + /// + /// Delete disk. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -251,14 +254,16 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Attach and create the lease of the disk to the virtual machine. - /// This operation can take a while to complete. + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. /// + /// + /// Attach and create the lease of the disk to the virtual machine. This + /// operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -280,14 +285,16 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginAttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginAttachWithHttpMessagesAsync(string labName, string userName, string name, AttachDiskProperties attachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Detach and break the lease of the disk attached to the virtual - /// machine. This operation can take a while to complete. + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. /// + /// + /// Detach and break the lease of the disk attached to the virtual machine. + /// This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -309,13 +316,14 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDetachWithHttpMessagesAsync(string labName, string userName, string name, DetachDiskProperties detachDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List disks in a given user profile. /// + /// + /// List disks in a given user profile. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -331,9 +339,7 @@ public partial interface IDisksOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IEnvironmentsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IEnvironmentsOperations.cs index ab482be08e9a..cdeb193ffd15 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IEnvironmentsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IEnvironmentsOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// EnvironmentsOperations operations. @@ -27,15 +16,18 @@ public partial interface IEnvironmentsOperations /// /// List environments in a given user profile. /// + /// + /// List environments in a given user profile. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the user profile. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface IEnvironmentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get environment. /// + /// + /// Get environment. + /// /// /// The name of the lab. /// @@ -66,7 +59,7 @@ public partial interface IEnvironmentsOperations /// /// /// Specify the $expand query. Example: - /// 'properties($select=deploymentProperties)' + /// 'properties($select=deploymentProperties)' /// /// /// The headers that will be added to request. @@ -80,14 +73,16 @@ public partial interface IEnvironmentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing environment. This operation can take - /// a while to complete. + /// Create or replace an existing environment. This operation can take a while + /// to complete. /// + /// + /// Create or replace an existing environment. This operation can take a while + /// to complete. + /// /// /// The name of the lab. /// @@ -112,13 +107,14 @@ public partial interface IEnvironmentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete environment. This operation can take a while to complete. /// + /// + /// Delete environment. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -137,14 +133,16 @@ public partial interface IEnvironmentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing environment. This operation can take - /// a while to complete. + /// Create or replace an existing environment. This operation can take a while + /// to complete. /// + /// + /// Create or replace an existing environment. This operation can take a while + /// to complete. + /// /// /// The name of the lab. /// @@ -169,13 +167,14 @@ public partial interface IEnvironmentsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, DtlEnvironment dtlEnvironment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete environment. This operation can take a while to complete. /// + /// + /// Delete environment. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -194,13 +193,14 @@ public partial interface IEnvironmentsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List environments in a given user profile. /// + /// + /// List environments in a given user profile. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -216,9 +216,7 @@ public partial interface IEnvironmentsOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IFormulasOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IFormulasOperations.cs index f24793a8023e..3be086a75344 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IFormulasOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IFormulasOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// FormulasOperations operations. @@ -27,12 +16,15 @@ public partial interface IFormulasOperations /// /// List formulas in a given lab. /// + /// + /// List formulas in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IFormulasOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get formula. /// + /// + /// Get formula. + /// /// /// The name of the lab. /// @@ -59,8 +52,7 @@ public partial interface IFormulasOperations /// The name of the formula. /// /// - /// Specify the $expand query. Example: - /// 'properties($select=description)' + /// Specify the $expand query. Example: 'properties($select=description)' /// /// /// The headers that will be added to request. @@ -74,14 +66,16 @@ public partial interface IFormulasOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing Formula. This operation can take a - /// while to complete. + /// Create or replace an existing Formula. This operation can take a while to + /// complete. /// + /// + /// Create or replace an existing Formula. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -89,8 +83,7 @@ public partial interface IFormulasOperations /// The name of the formula. /// /// - /// A formula for creating a VM, specifying an image base and other - /// parameters + /// A formula for creating a VM, specifying an image base and other parameters /// /// /// The headers that will be added to request. @@ -104,13 +97,14 @@ public partial interface IFormulasOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete formula. /// + /// + /// Delete formula. + /// /// /// The name of the lab. /// @@ -126,14 +120,16 @@ public partial interface IFormulasOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing Formula. This operation can take a - /// while to complete. + /// Create or replace an existing Formula. This operation can take a while to + /// complete. /// + /// + /// Create or replace an existing Formula. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -141,8 +137,7 @@ public partial interface IFormulasOperations /// The name of the formula. /// /// - /// A formula for creating a VM, specifying an image base and other - /// parameters + /// A formula for creating a VM, specifying an image base and other parameters /// /// /// The headers that will be added to request. @@ -156,13 +151,14 @@ public partial interface IFormulasOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, Formula formula, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List formulas in a given lab. /// + /// + /// List formulas in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -178,9 +174,7 @@ public partial interface IFormulasOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGalleryImagesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGalleryImagesOperations.cs index ca0b026cc549..d784ec710d03 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGalleryImagesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGalleryImagesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryImagesOperations operations. @@ -27,12 +16,15 @@ public partial interface IGalleryImagesOperations /// /// List gallery images in a given lab. /// + /// + /// List gallery images in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List gallery images in a given lab. /// + /// + /// List gallery images in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -67,9 +60,7 @@ public partial interface IGalleryImagesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGlobalSchedulesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGlobalSchedulesOperations.cs index 5158647efdf3..21a762f1a3c4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGlobalSchedulesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGlobalSchedulesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GlobalSchedulesOperations operations. @@ -27,8 +16,11 @@ public partial interface IGlobalSchedulesOperations /// /// List schedules in a subscription. /// + /// + /// List schedules in a subscription. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -42,15 +34,16 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List schedules in a resource group. /// + /// + /// List schedules in a resource group. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -64,18 +57,19 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get schedule. /// + /// + /// Get schedule. + /// /// /// The name of the schedule. /// /// - /// Specify the $expand query. Example: 'properties($select=status)' + /// Specify the $expand query. Example: 'properties($select=status)' /// /// /// The headers that will be added to request. @@ -89,13 +83,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing schedule. /// + /// + /// Create or replace an existing schedule. + /// /// /// The name of the schedule. /// @@ -114,13 +109,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string name, Schedule schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string name, Schedule schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete schedule. /// + /// + /// Delete schedule. + /// /// /// The name of the schedule. /// @@ -133,13 +129,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of schedules. /// + /// + /// Modify properties of schedules. + /// /// /// The name of the schedule. /// @@ -158,13 +155,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string name, ScheduleFragment schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string name, ScheduleFragment schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Execute a schedule. This operation can take a while to complete. /// + /// + /// Execute a schedule. This operation can take a while to complete. + /// /// /// The name of the schedule. /// @@ -177,14 +175,16 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ExecuteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ExecuteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Updates a schedule's target resource Id. This operation can take a - /// while to complete. + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. /// + /// + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. + /// /// /// The name of the schedule. /// @@ -200,13 +200,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Execute a schedule. This operation can take a while to complete. /// + /// + /// Execute a schedule. This operation can take a while to complete. + /// /// /// The name of the schedule. /// @@ -219,14 +220,16 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginExecuteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginExecuteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Updates a schedule's target resource Id. This operation can take a - /// while to complete. + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. /// + /// + /// Updates a schedule's target resource Id. This operation can take a while to + /// complete. + /// /// /// The name of the schedule. /// @@ -242,13 +245,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRetargetWithHttpMessagesAsync(string name, RetargetScheduleProperties retargetScheduleProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List schedules in a subscription. /// + /// + /// List schedules in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -264,13 +268,14 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List schedules in a resource group. /// + /// + /// List schedules in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -286,9 +291,7 @@ public partial interface IGlobalSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ILabsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ILabsOperations.cs index 0001041d5898..64a8bc4599f5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ILabsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ILabsOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LabsOperations operations. @@ -27,8 +16,11 @@ public partial interface ILabsOperations /// /// List labs in a subscription. /// + /// + /// List labs in a subscription. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -42,15 +34,16 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List labs in a resource group. /// + /// + /// List labs in a resource group. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The headers that will be added to request. @@ -64,19 +57,20 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get lab. /// + /// + /// Get lab. + /// /// /// The name of the lab. /// /// /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' + /// 'properties($select=defaultStorageAccount)' /// /// /// The headers that will be added to request. @@ -90,14 +84,16 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing lab. This operation can take a while - /// to complete. + /// Create or replace an existing lab. This operation can take a while to + /// complete. /// + /// + /// Create or replace an existing lab. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -116,13 +112,14 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete lab. This operation can take a while to complete. /// + /// + /// Delete lab. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -135,13 +132,14 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of labs. /// + /// + /// Modify properties of labs. + /// /// /// The name of the lab. /// @@ -160,14 +158,16 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string name, LabFragment lab, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string name, LabFragment lab, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Claim a random claimable virtual machine in the lab. This operation - /// can take a while to complete. + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. /// + /// + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. + /// /// /// The name of the lab. /// @@ -180,14 +180,16 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ClaimAnyVmWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ClaimAnyVmWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create virtual machines in a lab. This operation can take a while - /// to complete. + /// Create virtual machines in a lab. This operation can take a while to + /// complete. /// + /// + /// Create virtual machines in a lab. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -203,14 +205,16 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Exports the lab resource usage into a storage account This - /// operation can take a while to complete. + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. /// + /// + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. + /// /// /// The name of the lab. /// @@ -226,13 +230,14 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Generate a URI for uploading custom disk images to a Lab. /// + /// + /// Generate a URI for uploading custom disk images to a Lab. + /// /// /// The name of the lab. /// @@ -251,13 +256,14 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateUploadUriWithHttpMessagesAsync(string name, GenerateUploadUriParameter generateUploadUriParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GenerateUploadUriWithHttpMessagesAsync(string name, GenerateUploadUriParameter generateUploadUriParameter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List disk images available for custom image creation. /// + /// + /// List disk images available for custom image creation. + /// /// /// The name of the lab. /// @@ -273,14 +279,16 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVhdsWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVhdsWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing lab. This operation can take a while - /// to complete. + /// Create or replace an existing lab. This operation can take a while to + /// complete. /// + /// + /// Create or replace an existing lab. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -299,13 +307,14 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete lab. This operation can take a while to complete. /// + /// + /// Delete lab. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -318,14 +327,16 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Claim a random claimable virtual machine in the lab. This operation - /// can take a while to complete. + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. /// + /// + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. + /// /// /// The name of the lab. /// @@ -338,14 +349,16 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginClaimAnyVmWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginClaimAnyVmWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create virtual machines in a lab. This operation can take a while - /// to complete. + /// Create virtual machines in a lab. This operation can take a while to + /// complete. /// + /// + /// Create virtual machines in a lab. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -361,14 +374,16 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginCreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Exports the lab resource usage into a storage account This - /// operation can take a while to complete. + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. /// + /// + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. + /// /// /// The name of the lab. /// @@ -384,13 +399,14 @@ public partial interface ILabsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List labs in a subscription. /// + /// + /// List labs in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -406,13 +422,14 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List labs in a resource group. /// + /// + /// List labs in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -428,13 +445,14 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List disk images available for custom image creation. /// + /// + /// List disk images available for custom image creation. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -450,9 +468,7 @@ public partial interface ILabsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVhdsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVhdsNextWithHttpMessagesAsync(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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/INotificationChannelsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/INotificationChannelsOperations.cs index d3f90e86c2b9..30f5be91e895 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/INotificationChannelsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/INotificationChannelsOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NotificationChannelsOperations operations. @@ -27,12 +16,15 @@ public partial interface INotificationChannelsOperations /// /// List notificationchannels in a given lab. /// + /// + /// List notificationchannels in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface INotificationChannelsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get notificationchannel. /// + /// + /// Get notificationchannel. + /// /// /// The name of the lab. /// @@ -59,8 +52,7 @@ public partial interface INotificationChannelsOperations /// The name of the notificationChannel. /// /// - /// Specify the $expand query. Example: - /// 'properties($select=webHookUrl)' + /// Specify the $expand query. Example: 'properties($select=webHookUrl)' /// /// /// The headers that will be added to request. @@ -74,13 +66,14 @@ public partial interface INotificationChannelsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing notificationChannel. /// + /// + /// Create or replace an existing notificationChannel. + /// /// /// The name of the lab. /// @@ -102,13 +95,14 @@ public partial interface INotificationChannelsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, NotificationChannel notificationChannel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, NotificationChannel notificationChannel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete notificationchannel. /// + /// + /// Delete notificationchannel. + /// /// /// The name of the lab. /// @@ -124,13 +118,14 @@ public partial interface INotificationChannelsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of notificationchannels. /// + /// + /// Modify properties of notificationchannels. + /// /// /// The name of the lab. /// @@ -152,13 +147,14 @@ public partial interface INotificationChannelsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string name, NotificationChannelFragment notificationChannel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, NotificationChannelFragment notificationChannel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Send notification to provided channel. /// + /// + /// Send notification to provided channel. + /// /// /// The name of the lab. /// @@ -177,13 +173,14 @@ public partial interface INotificationChannelsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task NotifyWithHttpMessagesAsync(string labName, string name, NotifyParameters notifyParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task NotifyWithHttpMessagesAsync(string labName, string name, NotifyParameters notifyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List notificationchannels in a given lab. /// + /// + /// List notificationchannels in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -199,9 +196,7 @@ public partial interface INotificationChannelsOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IOperations.cs index 938e9b9640ad..bdf90b917594 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IOperations.cs +++ b/src/DevTestLabs/DevTestLabs.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.DevTestLabs { - 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,6 +16,9 @@ public partial interface IOperations /// /// Get operation. /// + /// + /// Get operation. + /// /// /// The name of the location. /// @@ -44,9 +37,7 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string locationName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string locationName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPoliciesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPoliciesOperations.cs index f9ceb68a1ec4..a25a8af23525 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPoliciesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPoliciesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PoliciesOperations operations. @@ -27,15 +16,18 @@ public partial interface IPoliciesOperations /// /// List policies in a given policy set. /// + /// + /// List policies in a given policy set. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the policy set. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface IPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string policySetName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string policySetName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get policy. /// + /// + /// Get policy. + /// /// /// The name of the lab. /// @@ -65,8 +58,7 @@ public partial interface IPoliciesOperations /// The name of the policy. /// /// - /// Specify the $expand query. Example: - /// 'properties($select=description)' + /// Specify the $expand query. Example: 'properties($select=description)' /// /// /// The headers that will be added to request. @@ -80,13 +72,14 @@ public partial interface IPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string policySetName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string policySetName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing policy. /// + /// + /// Create or replace an existing policy. + /// /// /// The name of the lab. /// @@ -111,13 +104,14 @@ public partial interface IPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string policySetName, string name, Policy policy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string policySetName, string name, Policy policy, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete policy. /// + /// + /// Delete policy. + /// /// /// The name of the lab. /// @@ -136,13 +130,14 @@ public partial interface IPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string policySetName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string policySetName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of policies. /// + /// + /// Modify properties of policies. + /// /// /// The name of the lab. /// @@ -167,13 +162,14 @@ public partial interface IPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string policySetName, string name, PolicyFragment policy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string policySetName, string name, PolicyFragment policy, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List policies in a given policy set. /// + /// + /// List policies in a given policy set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -189,9 +185,7 @@ public partial interface IPoliciesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPolicySetsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPolicySetsOperations.cs index 0fd643c2f1ad..9b53488d23c8 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPolicySetsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPolicySetsOperations.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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PolicySetsOperations operations. @@ -26,6 +16,9 @@ public partial interface IPolicySetsOperations /// /// Evaluates lab policy. /// + /// + /// Evaluates lab policy. + /// /// /// The name of the lab. /// @@ -47,9 +40,7 @@ public partial interface IPolicySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> EvaluatePoliciesWithHttpMessagesAsync(string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> EvaluatePoliciesWithHttpMessagesAsync(string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IProviderOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IProviderOperations.cs index 4f9ea196066a..1c5b0a56092b 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IProviderOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IProviderOperations.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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ProviderOperations operations. @@ -26,6 +16,9 @@ public partial interface IProviderOperations /// /// Result of the request to list REST API operations /// + /// + /// Result of the request to list REST API operations + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IProviderOperations /// /// 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)); + /// /// Result of the request to list REST API operations /// + /// + /// Result of the request to list REST API operations + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -60,9 +54,7 @@ public partial interface IProviderOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISchedulesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISchedulesOperations.cs index 5f51eaedec39..6b4a0f3f5eb4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISchedulesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISchedulesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SchedulesOperations operations. @@ -27,12 +16,15 @@ public partial interface ISchedulesOperations /// /// List schedules in a given lab. /// + /// + /// List schedules in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface ISchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get schedule. /// + /// + /// Get schedule. + /// /// /// The name of the lab. /// @@ -59,7 +52,7 @@ public partial interface ISchedulesOperations /// The name of the schedule. /// /// - /// Specify the $expand query. Example: 'properties($select=status)' + /// Specify the $expand query. Example: 'properties($select=status)' /// /// /// The headers that will be added to request. @@ -73,13 +66,14 @@ public partial interface ISchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing schedule. /// + /// + /// Create or replace an existing schedule. + /// /// /// The name of the lab. /// @@ -101,13 +95,14 @@ public partial interface ISchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Schedule schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Schedule schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete schedule. /// + /// + /// Delete schedule. + /// /// /// The name of the lab. /// @@ -123,13 +118,14 @@ public partial interface ISchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of schedules. /// + /// + /// Modify properties of schedules. + /// /// /// The name of the lab. /// @@ -151,13 +147,14 @@ public partial interface ISchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string name, ScheduleFragment schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, ScheduleFragment schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Execute a schedule. This operation can take a while to complete. /// + /// + /// Execute a schedule. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -173,13 +170,14 @@ public partial interface ISchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ExecuteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ExecuteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all applicable schedules /// + /// + /// Lists all applicable schedules + /// /// /// The name of the lab. /// @@ -198,13 +196,14 @@ public partial interface ISchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListApplicableWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListApplicableWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Execute a schedule. This operation can take a while to complete. /// + /// + /// Execute a schedule. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -220,13 +219,14 @@ public partial interface ISchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginExecuteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginExecuteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List schedules in a given lab. /// + /// + /// List schedules in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -242,13 +242,14 @@ public partial interface ISchedulesOperations /// /// 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)); + /// /// Lists all applicable schedules /// + /// + /// Lists all applicable schedules + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -264,9 +265,7 @@ public partial interface ISchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListApplicableNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListApplicableNextWithHttpMessagesAsync(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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISecretsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISecretsOperations.cs index 9437c29de280..0e5c8ce5a420 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISecretsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISecretsOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SecretsOperations operations. @@ -27,15 +16,18 @@ public partial interface ISecretsOperations /// /// List secrets in a given user profile. /// + /// + /// List secrets in a given user profile. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the user profile. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface ISecretsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get secret. /// + /// + /// Get secret. + /// /// /// The name of the lab. /// @@ -65,7 +58,7 @@ public partial interface ISecretsOperations /// The name of the secret. /// /// - /// Specify the $expand query. Example: 'properties($select=value)' + /// Specify the $expand query. Example: 'properties($select=value)' /// /// /// The headers that will be added to request. @@ -79,13 +72,14 @@ public partial interface ISecretsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing secret. /// + /// + /// Create or replace an existing secret. + /// /// /// The name of the lab. /// @@ -110,13 +104,14 @@ public partial interface ISecretsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Secret secret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Secret secret, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete secret. /// + /// + /// Delete secret. + /// /// /// The name of the lab. /// @@ -135,13 +130,14 @@ public partial interface ISecretsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List secrets in a given user profile. /// + /// + /// List secrets in a given user profile. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -157,9 +153,7 @@ public partial interface ISecretsOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceRunnersOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceRunnersOperations.cs index 6b629dd20228..eb1a08552291 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceRunnersOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceRunnersOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ServiceRunnersOperations operations. @@ -27,12 +16,15 @@ public partial interface IServiceRunnersOperations /// /// List service runners in a given lab. /// + /// + /// List service runners in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IServiceRunnersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get service runner. /// + /// + /// Get service runner. + /// /// /// The name of the lab. /// @@ -70,13 +63,14 @@ public partial interface IServiceRunnersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing Service runner. /// + /// + /// Create or replace an existing Service runner. + /// /// /// The name of the lab. /// @@ -98,13 +92,14 @@ public partial interface IServiceRunnersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ServiceRunner serviceRunner, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete service runner. /// + /// + /// Delete service runner. + /// /// /// The name of the lab. /// @@ -120,13 +115,14 @@ public partial interface IServiceRunnersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List service runners in a given lab. /// + /// + /// List service runners in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -142,9 +138,7 @@ public partial interface IServiceRunnersOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IUsersOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IUsersOperations.cs index e8c07bf7c643..448cf98df6e5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IUsersOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IUsersOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// UsersOperations operations. @@ -27,12 +16,15 @@ public partial interface IUsersOperations /// /// List user profiles in a given lab. /// + /// + /// List user profiles in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IUsersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get user profile. /// + /// + /// Get user profile. + /// /// /// The name of the lab. /// @@ -59,7 +52,7 @@ public partial interface IUsersOperations /// The name of the user profile. /// /// - /// Specify the $expand query. Example: 'properties($select=identity)' + /// Specify the $expand query. Example: 'properties($select=identity)' /// /// /// The headers that will be added to request. @@ -73,13 +66,14 @@ public partial interface IUsersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing user profile. /// + /// + /// Create or replace an existing user profile. + /// /// /// The name of the lab. /// @@ -101,13 +95,14 @@ public partial interface IUsersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, User user, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, User user, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete user profile. This operation can take a while to complete. /// + /// + /// Delete user profile. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -123,13 +118,14 @@ public partial interface IUsersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of user profiles. /// + /// + /// Modify properties of user profiles. + /// /// /// The name of the lab. /// @@ -151,13 +147,14 @@ public partial interface IUsersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string name, UserFragment user, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, UserFragment user, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete user profile. This operation can take a while to complete. /// + /// + /// Delete user profile. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -173,13 +170,14 @@ public partial interface IUsersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List user profiles in a given lab. /// + /// + /// List user profiles in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -195,9 +193,7 @@ public partial interface IUsersOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachineSchedulesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachineSchedulesOperations.cs index 52b4c4e86c9e..f13c61fe3a7a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachineSchedulesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachineSchedulesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineSchedulesOperations operations. @@ -27,15 +16,18 @@ public partial interface IVirtualMachineSchedulesOperations /// /// List schedules in a given virtual machine. /// + /// + /// List schedules in a given virtual machine. + /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the virtual machine. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -48,13 +40,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, string virtualMachineName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string virtualMachineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get schedule. /// + /// + /// Get schedule. + /// /// /// The name of the lab. /// @@ -65,7 +58,7 @@ public partial interface IVirtualMachineSchedulesOperations /// The name of the schedule. /// /// - /// Specify the $expand query. Example: 'properties($select=status)' + /// Specify the $expand query. Example: 'properties($select=status)' /// /// /// The headers that will be added to request. @@ -79,13 +72,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string virtualMachineName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string virtualMachineName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or replace an existing schedule. /// + /// + /// Create or replace an existing schedule. + /// /// /// The name of the lab. /// @@ -110,13 +104,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Schedule schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Schedule schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete schedule. /// + /// + /// Delete schedule. + /// /// /// The name of the lab. /// @@ -135,13 +130,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of schedules. /// + /// + /// Modify properties of schedules. + /// /// /// The name of the lab. /// @@ -166,13 +162,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, ScheduleFragment schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, ScheduleFragment schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Execute a schedule. This operation can take a while to complete. /// + /// + /// Execute a schedule. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -191,13 +188,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Execute a schedule. This operation can take a while to complete. /// + /// + /// Execute a schedule. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -216,13 +214,14 @@ public partial interface IVirtualMachineSchedulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List schedules in a given virtual machine. /// + /// + /// List schedules in a given virtual machine. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -238,9 +237,7 @@ public partial interface IVirtualMachineSchedulesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachinesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachinesOperations.cs index 5c3fa2f6c251..fb98c49c3236 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachinesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachinesOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachinesOperations operations. @@ -27,12 +16,15 @@ public partial interface IVirtualMachinesOperations /// /// List virtual machines in a given lab. /// + /// + /// List virtual machines in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get virtual machine. /// + /// + /// Get virtual machine. + /// /// /// The name of the lab. /// @@ -60,7 +53,7 @@ public partial interface IVirtualMachinesOperations /// /// /// Specify the $expand query. Example: - /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' /// /// /// The headers that will be added to request. @@ -74,14 +67,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing Virtual machine. This operation can - /// take a while to complete. + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. /// + /// + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. + /// /// /// The name of the lab. /// @@ -103,14 +98,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete virtual machine. This operation can take a while to - /// complete. + /// Delete virtual machine. This operation can take a while to complete. /// + /// + /// Delete virtual machine. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -126,13 +121,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of virtual machines. /// + /// + /// Modify properties of virtual machines. + /// /// /// The name of the lab. /// @@ -154,14 +150,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachineFragment labVirtualMachine, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachineFragment labVirtualMachine, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Attach a new or existing data disk to virtual machine. This - /// operation can take a while to complete. + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. /// + /// + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. + /// /// /// The name of the lab. /// @@ -169,8 +167,7 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// Request body for adding a new or existing data disk to a virtual - /// machine. + /// Request body for adding a new or existing data disk to a virtual machine. /// /// /// The headers that will be added to request. @@ -181,14 +178,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task AddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task AddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Apply artifacts to virtual machine. This operation can take a while - /// to complete. + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. /// + /// + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -207,14 +206,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Take ownership of an existing virtual machine This operation can - /// take a while to complete. + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. /// + /// + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. + /// /// /// The name of the lab. /// @@ -230,14 +231,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ClaimWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ClaimWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Detach the specified disk from the virtual machine. This operation - /// can take a while to complete. + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. /// + /// + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. + /// /// /// The name of the lab. /// @@ -256,13 +259,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all applicable schedules /// + /// + /// Lists all applicable schedules + /// /// /// The name of the lab. /// @@ -281,14 +285,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListApplicableSchedulesWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListApplicableSchedulesWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Start a virtual machine. This operation can take a while to - /// complete. + /// Start a virtual machine. This operation can take a while to complete. /// + /// + /// Start a virtual machine. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -304,13 +308,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stop a virtual machine This operation can take a while to complete. /// + /// + /// Stop a virtual machine This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -326,14 +331,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StopWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StopWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing Virtual machine. This operation can - /// take a while to complete. + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. /// + /// + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. + /// /// /// The name of the lab. /// @@ -355,14 +362,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete virtual machine. This operation can take a while to - /// complete. + /// Delete virtual machine. This operation can take a while to complete. /// + /// + /// Delete virtual machine. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -378,14 +385,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Attach a new or existing data disk to virtual machine. This - /// operation can take a while to complete. + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. /// + /// + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. + /// /// /// The name of the lab. /// @@ -393,8 +402,7 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// Request body for adding a new or existing data disk to a virtual - /// machine. + /// Request body for adding a new or existing data disk to a virtual machine. /// /// /// The headers that will be added to request. @@ -405,14 +413,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginAddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginAddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Apply artifacts to virtual machine. This operation can take a while - /// to complete. + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. /// + /// + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. + /// /// /// The name of the lab. /// @@ -431,14 +441,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Take ownership of an existing virtual machine This operation can - /// take a while to complete. + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. /// + /// + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. + /// /// /// The name of the lab. /// @@ -454,14 +466,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginClaimWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginClaimWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Detach the specified disk from the virtual machine. This operation - /// can take a while to complete. + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. /// + /// + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. + /// /// /// The name of the lab. /// @@ -480,14 +494,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Start a virtual machine. This operation can take a while to - /// complete. + /// Start a virtual machine. This operation can take a while to complete. /// + /// + /// Start a virtual machine. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -503,13 +517,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Stop a virtual machine This operation can take a while to complete. /// + /// + /// Stop a virtual machine This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -525,13 +540,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStopWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List virtual machines in a given lab. /// + /// + /// List virtual machines in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -547,9 +563,7 @@ public partial interface IVirtualMachinesOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualNetworksOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualNetworksOperations.cs index aee7a53a1bbe..2eeabdcc2720 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualNetworksOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualNetworksOperations.cs @@ -1,23 +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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualNetworksOperations operations. @@ -27,12 +16,15 @@ public partial interface IVirtualNetworksOperations /// /// List virtual networks in a given lab. /// + /// + /// List virtual networks in a given lab. + /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the operation. - /// /// /// The headers that will be added to request. /// @@ -45,13 +37,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get virtual network. /// + /// + /// Get virtual network. + /// /// /// The name of the lab. /// @@ -59,8 +52,7 @@ public partial interface IVirtualNetworksOperations /// The name of the virtual network. /// /// - /// Specify the $expand query. Example: - /// 'properties($expand=externalSubnets)' + /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' /// /// /// The headers that will be added to request. @@ -74,14 +66,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing virtual network. This operation can - /// take a while to complete. + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. /// + /// + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. + /// /// /// The name of the lab. /// @@ -103,14 +97,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete virtual network. This operation can take a while to - /// complete. + /// Delete virtual network. This operation can take a while to complete. /// + /// + /// Delete virtual network. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -126,13 +120,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Modify properties of virtual networks. /// + /// + /// Modify properties of virtual networks. + /// /// /// The name of the lab. /// @@ -154,14 +149,16 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string labName, string name, VirtualNetworkFragment virtualNetwork, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, VirtualNetworkFragment virtualNetwork, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or replace an existing virtual network. This operation can - /// take a while to complete. + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. /// + /// + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. + /// /// /// The name of the lab. /// @@ -183,14 +180,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete virtual network. This operation can take a while to - /// complete. + /// Delete virtual network. This operation can take a while to complete. /// + /// + /// Delete virtual network. This operation can take a while to complete. + /// /// /// The name of the lab. /// @@ -206,13 +203,14 @@ public partial interface IVirtualNetworksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List virtual networks in a given lab. /// + /// + /// List virtual networks in a given lab. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -228,9 +226,7 @@ public partial interface IVirtualNetworksOperations /// /// 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperations.cs index 32fe146c0bad..da98e25c5ec4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// LabsOperations operations. /// - internal partial class LabsOperations : IServiceOperations, ILabsOperations + internal partial class LabsOperations : Microsoft.Rest.IServiceOperations, ILabsOperations { /// /// Initializes a new instance of the LabsOperations class. @@ -37,13 +24,13 @@ internal partial class LabsOperations : IServiceOperations, I /// /// Thrown when a required parameter is null /// - internal LabsOperations(DevTestLabsClient client) + internal LabsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -55,7 +42,7 @@ internal LabsOperations(DevTestLabsClient client) /// List labs in a subscription. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -63,13 +50,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -78,68 +65,78 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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("odataQuery", odataQuery); + + 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.DevTestLab/labs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _lab = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_lab)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_lab); } } - if (Client.ApiVersion != null) + 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) @@ -151,55 +148,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -209,9 +207,10 @@ internal LabsOperations(DevTestLabsClient 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,30 +221,34 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List labs in a resource group. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// Headers that will be added to request. @@ -253,13 +256,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -268,73 +271,84 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.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("odataQuery", odataQuery); + + 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.DevTestLab/labs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _lab = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_lab)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_lab); } } - if (Client.ApiVersion != null) + 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) @@ -346,55 +360,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -404,9 +419,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -417,25 +433,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get lab. /// @@ -444,7 +464,7 @@ internal LabsOperations(DevTestLabsClient client) /// /// /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' + /// 'properties($select=defaultStorageAccount)' /// /// /// Headers that will be added to request. @@ -452,13 +472,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -467,75 +487,87 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -547,55 +579,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -605,9 +638,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -618,25 +652,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing lab. This operation can take a while to /// complete. @@ -648,16 +686,16 @@ internal LabsOperations(DevTestLabsClient client) /// A lab. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(name, lab, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(name, lab, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -667,16 +705,16 @@ internal LabsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -694,13 +732,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -709,75 +747,86 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string name, LabFragment lab, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string name, LabFragment lab, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (lab == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "lab"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (lab == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "lab"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("lab", lab); + 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.DevTestLab/labs/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -789,61 +838,62 @@ internal LabsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(lab != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(lab, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lab, 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); } + 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) @@ -853,9 +903,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -866,25 +917,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Claim a random claimable virtual machine in the lab. This operation can /// take a while to complete. @@ -893,16 +948,16 @@ internal LabsOperations(DevTestLabsClient client) /// The name of the lab. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ClaimAnyVmWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ClaimAnyVmWithHttpMessagesAsync(string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginClaimAnyVmWithHttpMessagesAsync(name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginClaimAnyVmWithHttpMessagesAsync(name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -916,16 +971,16 @@ internal LabsOperations(DevTestLabsClient client) /// Properties for creating a virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task CreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginCreateEnvironmentWithHttpMessagesAsync(name, labVirtualMachineCreationParameter, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateEnvironmentWithHttpMessagesAsync(name, labVirtualMachineCreationParameter, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -939,16 +994,16 @@ internal LabsOperations(DevTestLabsClient client) /// The parameters of the export operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExportResourceUsageWithHttpMessagesAsync(name, exportResourceUsageParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExportResourceUsageWithHttpMessagesAsync(name, exportResourceUsageParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -966,13 +1021,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -981,75 +1036,87 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GenerateUploadUriWithHttpMessagesAsync(string name, GenerateUploadUriParameter generateUploadUriParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GenerateUploadUriWithHttpMessagesAsync(string name, GenerateUploadUriParameter generateUploadUriParameter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (generateUploadUriParameter == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "generateUploadUriParameter"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (generateUploadUriParameter == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "generateUploadUriParameter"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("generateUploadUriParameter", generateUploadUriParameter); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateUploadUri", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GenerateUploadUri", 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.DevTestLab/labs/{name}/generateUploadUri").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1061,61 +1128,62 @@ internal LabsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(generateUploadUriParameter != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateUploadUriParameter, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(generateUploadUriParameter, 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); } + 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) @@ -1125,9 +1193,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -1138,25 +1207,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List disk images available for custom image creation. /// @@ -1169,13 +1242,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -1184,70 +1257,81 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVhdsWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVhdsWithHttpMessagesAsync(string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVhds", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVhds", 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.DevTestLab/labs/{name}/listVhds").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1259,55 +1343,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -1317,9 +1402,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -1330,25 +1416,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing lab. This operation can take a while to /// complete. @@ -1365,13 +1455,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -1380,75 +1470,87 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string name, Lab lab, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (lab == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "lab"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (lab == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "lab"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("lab", lab); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1460,61 +1562,62 @@ internal LabsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(lab != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(lab, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(lab, 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); } + 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) @@ -1524,9 +1627,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -1537,16 +1641,16 @@ internal LabsOperations(DevTestLabsClient 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 @@ -1555,25 +1659,29 @@ internal LabsOperations(DevTestLabsClient 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 lab. This operation can take a while to complete. /// @@ -1586,10 +1694,10 @@ internal LabsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1598,70 +1706,81 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + + 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.DevTestLab/labs/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1673,55 +1792,56 @@ internal LabsOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -1731,20 +1851,25 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Claim a random claimable virtual machine in the lab. This operation can /// take a while to complete. @@ -1758,10 +1883,10 @@ internal LabsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1770,70 +1895,81 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginClaimAnyVmWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginClaimAnyVmWithHttpMessagesAsync(string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginClaimAnyVm", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginClaimAnyVm", 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.DevTestLab/labs/{name}/claimAnyVm").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1845,55 +1981,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -1903,20 +2040,25 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create virtual machines in a lab. This operation can take a while to /// complete. @@ -1933,10 +2075,10 @@ internal LabsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1945,75 +2087,87 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginCreateEnvironmentWithHttpMessagesAsync(string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (labVirtualMachineCreationParameter == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labVirtualMachineCreationParameter"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (labVirtualMachineCreationParameter == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labVirtualMachineCreationParameter"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("labVirtualMachineCreationParameter", labVirtualMachineCreationParameter); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateEnvironment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateEnvironment", 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.DevTestLab/labs/{name}/createEnvironment").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -2025,61 +2179,62 @@ internal LabsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(labVirtualMachineCreationParameter != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(labVirtualMachineCreationParameter, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(labVirtualMachineCreationParameter, 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); } + 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) @@ -2089,20 +2244,25 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Exports the lab resource usage into a storage account This operation can /// take a while to complete. @@ -2119,10 +2279,10 @@ internal LabsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2131,75 +2291,87 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginExportResourceUsageWithHttpMessagesAsync(string name, ExportResourceUsageParameters exportResourceUsageParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (exportResourceUsageParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "exportResourceUsageParameters"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (name == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (exportResourceUsageParameters == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "exportResourceUsageParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("name", name); + tracingParameters.Add("exportResourceUsageParameters", exportResourceUsageParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExportResourceUsage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExportResourceUsage", 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.DevTestLab/labs/{name}/exportResourceUsage").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -2211,61 +2383,62 @@ internal LabsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(exportResourceUsageParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(exportResourceUsageParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(exportResourceUsageParameters, 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); } + 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) @@ -2275,20 +2448,25 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List labs in a subscription. /// @@ -2301,13 +2479,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -2316,51 +2494,54 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", 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) @@ -2372,55 +2553,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -2430,9 +2612,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -2443,25 +2626,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List labs in a resource group. /// @@ -2474,13 +2661,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -2489,51 +2676,54 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", 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) @@ -2545,55 +2735,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -2603,9 +2794,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -2616,25 +2808,29 @@ internal LabsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List disk images available for custom image creation. /// @@ -2647,13 +2843,13 @@ internal LabsOperations(DevTestLabsClient 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 /// /// @@ -2662,51 +2858,54 @@ internal LabsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVhdsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVhdsNextWithHttpMessagesAsync(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, "ListVhdsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVhdsNext", 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("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) @@ -2718,55 +2917,56 @@ internal LabsOperations(DevTestLabsClient 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); } + 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) @@ -2776,9 +2976,10 @@ internal LabsOperations(DevTestLabsClient 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(); @@ -2789,24 +2990,28 @@ internal LabsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperationsExtensions.cs index 533204a16518..7e686202c0a6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperationsExtensions.cs @@ -1,720 +1,643 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LabsOperations. + /// Extension methods for LabsOperations /// public static partial class LabsOperationsExtensions { - /// - /// List labs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListBySubscription(this ILabsOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListBySubscriptionAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List labs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this ILabsOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List labs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListByResourceGroup(this ILabsOperations operations, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListByResourceGroupAsync(odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List labs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ILabsOperations operations, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' - /// - public static Lab Get(this ILabsOperations operations, string name, string expand = default(string)) - { - return operations.GetAsync(name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($select=defaultStorageAccount)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILabsOperations operations, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// A lab. - /// - public static Lab CreateOrUpdate(this ILabsOperations operations, string name, Lab lab) - { - return operations.CreateOrUpdateAsync(name, lab).GetAwaiter().GetResult(); - } - - /// - /// Create or replace an existing lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// A lab. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILabsOperations operations, string name, Lab lab, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(name, lab, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete lab. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - public static void Delete(this ILabsOperations operations, string name) - { - operations.DeleteAsync(name).GetAwaiter().GetResult(); - } - - /// - /// Delete lab. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILabsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Modify properties of labs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// A lab. - /// - public static Lab Update(this ILabsOperations operations, string name, LabFragment lab) - { - return operations.UpdateAsync(name, lab).GetAwaiter().GetResult(); - } - - /// - /// Modify properties of labs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// A lab. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ILabsOperations operations, string name, LabFragment lab, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(name, lab, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Claim a random claimable virtual machine in the lab. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - public static void ClaimAnyVm(this ILabsOperations operations, string name) - { - operations.ClaimAnyVmAsync(name).GetAwaiter().GetResult(); - } - - /// - /// Claim a random claimable virtual machine in the lab. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The cancellation token. - /// - public static async Task ClaimAnyVmAsync(this ILabsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ClaimAnyVmWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create virtual machines in a lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Properties for creating a virtual machine. - /// - public static void CreateEnvironment(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) - { - operations.CreateEnvironmentAsync(name, labVirtualMachineCreationParameter).GetAwaiter().GetResult(); - } - - /// - /// Create virtual machines in a lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Properties for creating a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task CreateEnvironmentAsync(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CreateEnvironmentWithHttpMessagesAsync(name, labVirtualMachineCreationParameter, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Exports the lab resource usage into a storage account This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The parameters of the export operation. - /// - public static void ExportResourceUsage(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters) - { - operations.ExportResourceUsageAsync(name, exportResourceUsageParameters).GetAwaiter().GetResult(); - } - - /// - /// Exports the lab resource usage into a storage account This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The parameters of the export operation. - /// - /// - /// The cancellation token. - /// - public static async Task ExportResourceUsageAsync(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ExportResourceUsageWithHttpMessagesAsync(name, exportResourceUsageParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Generate a URI for uploading custom disk images to a Lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Properties for generating an upload URI. - /// - public static GenerateUploadUriResponse GenerateUploadUri(this ILabsOperations operations, string name, GenerateUploadUriParameter generateUploadUriParameter) - { - return operations.GenerateUploadUriAsync(name, generateUploadUriParameter).GetAwaiter().GetResult(); - } - - /// - /// Generate a URI for uploading custom disk images to a Lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Properties for generating an upload URI. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateUploadUriAsync(this ILabsOperations operations, string name, GenerateUploadUriParameter generateUploadUriParameter, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateUploadUriWithHttpMessagesAsync(name, generateUploadUriParameter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List disk images available for custom image creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - public static IPage ListVhds(this ILabsOperations operations, string name) - { - return operations.ListVhdsAsync(name).GetAwaiter().GetResult(); - } - - /// - /// List disk images available for custom image creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVhdsAsync(this ILabsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVhdsWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// A lab. - /// - public static Lab BeginCreateOrUpdate(this ILabsOperations operations, string name, Lab lab) - { - return operations.BeginCreateOrUpdateAsync(name, lab).GetAwaiter().GetResult(); - } - - /// - /// Create or replace an existing lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// A lab. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ILabsOperations operations, string name, Lab lab, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(name, lab, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete lab. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - public static void BeginDelete(this ILabsOperations operations, string name) - { - operations.BeginDeleteAsync(name).GetAwaiter().GetResult(); - } - - /// - /// Delete lab. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ILabsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Claim a random claimable virtual machine in the lab. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - public static void BeginClaimAnyVm(this ILabsOperations operations, string name) - { - operations.BeginClaimAnyVmAsync(name).GetAwaiter().GetResult(); - } - - /// - /// Claim a random claimable virtual machine in the lab. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The cancellation token. - /// - public static async Task BeginClaimAnyVmAsync(this ILabsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginClaimAnyVmWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create virtual machines in a lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Properties for creating a virtual machine. - /// - public static void BeginCreateEnvironment(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) - { - operations.BeginCreateEnvironmentAsync(name, labVirtualMachineCreationParameter).GetAwaiter().GetResult(); - } - - /// - /// Create virtual machines in a lab. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// Properties for creating a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateEnvironmentAsync(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCreateEnvironmentWithHttpMessagesAsync(name, labVirtualMachineCreationParameter, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Exports the lab resource usage into a storage account This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The parameters of the export operation. - /// - public static void BeginExportResourceUsage(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters) - { - operations.BeginExportResourceUsageAsync(name, exportResourceUsageParameters).GetAwaiter().GetResult(); - } - - /// - /// Exports the lab resource usage into a storage account This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The parameters of the export operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginExportResourceUsageAsync(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginExportResourceUsageWithHttpMessagesAsync(name, exportResourceUsageParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List labs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this ILabsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List labs in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this ILabsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List labs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this ILabsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List labs in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this ILabsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List disk images available for custom image creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListVhdsNext(this ILabsOperations operations, string nextPageLink) - { - return operations.ListVhdsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List disk images available for custom image creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListVhdsNextAsync(this ILabsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVhdsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// List labs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this ILabsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((ILabsOperations)operations).ListBySubscriptionAsync(odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List labs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ILabsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List labs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ILabsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((ILabsOperations)operations).ListByResourceGroupAsync(odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List labs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ILabsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// Specify the $expand query. Example: + /// 'properties($select=defaultStorageAccount)' + /// + public static Lab Get(this ILabsOperations operations, string name, string expand = default(string)) + { + return ((ILabsOperations)operations).GetAsync(name, expand).GetAwaiter().GetResult(); + } + + /// + /// Get lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// Specify the $expand query. Example: + /// 'properties($select=defaultStorageAccount)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILabsOperations operations, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(name, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or replace an existing lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static Lab CreateOrUpdate(this ILabsOperations operations, string name, Lab lab) + { + return ((ILabsOperations)operations).CreateOrUpdateAsync(name, lab).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILabsOperations operations, string name, Lab lab, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(name, lab, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete lab. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void Delete(this ILabsOperations operations, string name) + { + ((ILabsOperations)operations).DeleteAsync(name).GetAwaiter().GetResult(); + } + + /// + /// Delete lab. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILabsOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of labs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static Lab Update(this ILabsOperations operations, string name, LabFragment lab) + { + return ((ILabsOperations)operations).UpdateAsync(name, lab).GetAwaiter().GetResult(); + } + + /// + /// Modify properties of labs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ILabsOperations operations, string name, LabFragment lab, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(name, lab, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void ClaimAnyVm(this ILabsOperations operations, string name) + { + ((ILabsOperations)operations).ClaimAnyVmAsync(name).GetAwaiter().GetResult(); + } + + /// + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ClaimAnyVmAsync(this ILabsOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ClaimAnyVmWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create virtual machines in a lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void CreateEnvironment(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) + { + ((ILabsOperations)operations).CreateEnvironmentAsync(name, labVirtualMachineCreationParameter).GetAwaiter().GetResult(); + } + + /// + /// Create virtual machines in a lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateEnvironmentAsync(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CreateEnvironmentWithHttpMessagesAsync(name, labVirtualMachineCreationParameter, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void ExportResourceUsage(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters) + { + ((ILabsOperations)operations).ExportResourceUsageAsync(name, exportResourceUsageParameters).GetAwaiter().GetResult(); + } + + /// + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportResourceUsageAsync(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ExportResourceUsageWithHttpMessagesAsync(name, exportResourceUsageParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Generate a URI for uploading custom disk images to a Lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static GenerateUploadUriResponse GenerateUploadUri(this ILabsOperations operations, string name, GenerateUploadUriParameter generateUploadUriParameter) + { + return ((ILabsOperations)operations).GenerateUploadUriAsync(name, generateUploadUriParameter).GetAwaiter().GetResult(); + } + + /// + /// Generate a URI for uploading custom disk images to a Lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateUploadUriAsync(this ILabsOperations operations, string name, GenerateUploadUriParameter generateUploadUriParameter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GenerateUploadUriWithHttpMessagesAsync(name, generateUploadUriParameter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List disk images available for custom image creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage ListVhds(this ILabsOperations operations, string name) + { + return ((ILabsOperations)operations).ListVhdsAsync(name).GetAwaiter().GetResult(); + } + + /// + /// List disk images available for custom image creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVhdsAsync(this ILabsOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVhdsWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or replace an existing lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static Lab BeginCreateOrUpdate(this ILabsOperations operations, string name, Lab lab) + { + return ((ILabsOperations)operations).BeginCreateOrUpdateAsync(name, lab).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILabsOperations operations, string name, Lab lab, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(name, lab, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete lab. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void BeginDelete(this ILabsOperations operations, string name) + { + ((ILabsOperations)operations).BeginDeleteAsync(name).GetAwaiter().GetResult(); + } + + /// + /// Delete lab. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILabsOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void BeginClaimAnyVm(this ILabsOperations operations, string name) + { + ((ILabsOperations)operations).BeginClaimAnyVmAsync(name).GetAwaiter().GetResult(); + } + + /// + /// Claim a random claimable virtual machine in the lab. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginClaimAnyVmAsync(this ILabsOperations operations, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginClaimAnyVmWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create virtual machines in a lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void BeginCreateEnvironment(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) + { + ((ILabsOperations)operations).BeginCreateEnvironmentAsync(name, labVirtualMachineCreationParameter).GetAwaiter().GetResult(); + } + + /// + /// Create virtual machines in a lab. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateEnvironmentAsync(this ILabsOperations operations, string name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginCreateEnvironmentWithHttpMessagesAsync(name, labVirtualMachineCreationParameter, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + public static void BeginExportResourceUsage(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters) + { + ((ILabsOperations)operations).BeginExportResourceUsageAsync(name, exportResourceUsageParameters).GetAwaiter().GetResult(); + } + + /// + /// Exports the lab resource usage into a storage account This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExportResourceUsageAsync(this ILabsOperations operations, string name, ExportResourceUsageParameters exportResourceUsageParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginExportResourceUsageWithHttpMessagesAsync(name, exportResourceUsageParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List labs in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this ILabsOperations operations, string nextPageLink) + { + return ((ILabsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List labs in a subscription. + /// + /// + /// 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> ListBySubscriptionNextAsync(this ILabsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List labs in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ILabsOperations operations, string nextPageLink) + { + return ((ILabsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List labs in a resource group. + /// + /// + /// 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> ListByResourceGroupNextAsync(this ILabsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List disk images available for custom image creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListVhdsNext(this ILabsOperations operations, string nextPageLink) + { + return ((ILabsOperations)operations).ListVhdsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List disk images available for custom image creation. + /// + /// + /// 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> ListVhdsNextAsync(this ILabsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVhdsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedule.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedule.cs index c8b5d196a75e..fc162126d6cd 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedule.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedule.cs @@ -1,27 +1,17 @@ -// // 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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Schedules applicable to a virtual machine. The schedules may have been /// defined on a VM or on lab level. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicableSchedule : Resource { /// @@ -35,20 +25,35 @@ public ApplicableSchedule() /// /// Initializes a new instance of the ApplicableSchedule class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The auto-shutdown schedule, if one has - /// been set at the lab or lab resource level. - /// The auto-startup schedule, if one has - /// been set at the lab or lab resource level. - public ApplicableSchedule(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Schedule labVmsShutdown = default(Schedule), Schedule labVmsStartup = default(Schedule)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The auto-shutdown schedule, if one has been set at the lab or lab resource + /// level. + /// + + /// The auto-startup schedule, if one has been set at the lab or lab resource + /// level. + /// + public ApplicableSchedule(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), Schedule labVmsShutdown = default(Schedule), Schedule labVmsStartup = default(Schedule)) + + : base(id, name, type, location, tags) { - LabVmsShutdown = labVmsShutdown; - LabVmsStartup = labVmsStartup; + this.LabVmsShutdown = labVmsShutdown; + this.LabVmsStartup = labVmsStartup; CustomInit(); } @@ -57,19 +62,19 @@ public ApplicableSchedule() /// partial void CustomInit(); + /// - /// Gets or sets the auto-shutdown schedule, if one has been set at the - /// lab or lab resource level. + /// Gets or sets the auto-shutdown schedule, if one has been set at the lab or + /// lab resource level. /// - [JsonProperty(PropertyName = "properties.labVmsShutdown")] - public Schedule LabVmsShutdown { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVmsShutdown")] + public Schedule LabVmsShutdown {get; set; } /// - /// Gets or sets the auto-startup schedule, if one has been set at the - /// lab or lab resource level. + /// Gets or sets the auto-startup schedule, if one has been set at the lab or + /// lab resource level. /// - [JsonProperty(PropertyName = "properties.labVmsStartup")] - public Schedule LabVmsStartup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVmsStartup")] + public Schedule LabVmsStartup {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleFragment.cs index 82e9e38194f0..f08c3195525c 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleFragment.cs @@ -1,27 +1,17 @@ -// // 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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Schedules applicable to a virtual machine. The schedules may have been /// defined on a VM or on lab level. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ApplicableScheduleFragment : Resource { /// @@ -35,20 +25,35 @@ public ApplicableScheduleFragment() /// /// Initializes a new instance of the ApplicableScheduleFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The auto-shutdown schedule, if one has - /// been set at the lab or lab resource level. - /// The auto-startup schedule, if one has - /// been set at the lab or lab resource level. - public ApplicableScheduleFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ScheduleFragment labVmsShutdown = default(ScheduleFragment), ScheduleFragment labVmsStartup = default(ScheduleFragment)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The auto-shutdown schedule, if one has been set at the lab or lab resource + /// level. + /// + + /// The auto-startup schedule, if one has been set at the lab or lab resource + /// level. + /// + public ApplicableScheduleFragment(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), ScheduleFragment labVmsShutdown = default(ScheduleFragment), ScheduleFragment labVmsStartup = default(ScheduleFragment)) + + : base(id, name, type, location, tags) { - LabVmsShutdown = labVmsShutdown; - LabVmsStartup = labVmsStartup; + this.LabVmsShutdown = labVmsShutdown; + this.LabVmsStartup = labVmsStartup; CustomInit(); } @@ -57,19 +62,19 @@ public ApplicableScheduleFragment() /// partial void CustomInit(); + /// - /// Gets or sets the auto-shutdown schedule, if one has been set at the - /// lab or lab resource level. + /// Gets or sets the auto-shutdown schedule, if one has been set at the lab or + /// lab resource level. /// - [JsonProperty(PropertyName = "properties.labVmsShutdown")] - public ScheduleFragment LabVmsShutdown { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVmsShutdown")] + public ScheduleFragment LabVmsShutdown {get; set; } /// - /// Gets or sets the auto-startup schedule, if one has been set at the - /// lab or lab resource level. + /// Gets or sets the auto-startup schedule, if one has been set at the lab or + /// lab resource level. /// - [JsonProperty(PropertyName = "properties.labVmsStartup")] - public ScheduleFragment LabVmsStartup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVmsStartup")] + public ScheduleFragment LabVmsStartup {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleProperties.cs new file mode 100644 index 000000000000..95869137b09e --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleProperties.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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a schedules applicable to a virtual machine. + /// + public partial class ApplicableScheduleProperties + { + /// + /// Initializes a new instance of the ApplicableScheduleProperties class. + /// + public ApplicableScheduleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicableScheduleProperties class. + /// + + /// The auto-shutdown schedule, if one has been set at the lab or lab resource + /// level. + /// + + /// The auto-startup schedule, if one has been set at the lab or lab resource + /// level. + /// + public ApplicableScheduleProperties(Schedule labVmsShutdown = default(Schedule), Schedule labVmsStartup = default(Schedule)) + + { + this.LabVmsShutdown = labVmsShutdown; + this.LabVmsStartup = labVmsStartup; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the auto-shutdown schedule, if one has been set at the lab or + /// lab resource level. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVmsShutdown")] + public Schedule LabVmsShutdown {get; set; } + + /// + /// Gets or sets the auto-startup schedule, if one has been set at the lab or + /// lab resource level. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVmsStartup")] + public Schedule LabVmsStartup {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedulePropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedulePropertiesFragment.cs new file mode 100644 index 000000000000..3eb2d20041b2 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedulePropertiesFragment.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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a schedules applicable to a virtual machine. + /// + public partial class ApplicableSchedulePropertiesFragment + { + /// + /// Initializes a new instance of the ApplicableSchedulePropertiesFragment class. + /// + public ApplicableSchedulePropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicableSchedulePropertiesFragment class. + /// + + /// The auto-shutdown schedule, if one has been set at the lab or lab resource + /// level. + /// + + /// The auto-startup schedule, if one has been set at the lab or lab resource + /// level. + /// + public ApplicableSchedulePropertiesFragment(ScheduleFragment labVmsShutdown = default(ScheduleFragment), ScheduleFragment labVmsStartup = default(ScheduleFragment)) + + { + this.LabVmsShutdown = labVmsShutdown; + this.LabVmsStartup = labVmsStartup; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the auto-shutdown schedule, if one has been set at the lab or + /// lab resource level. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVmsShutdown")] + public ScheduleFragment LabVmsShutdown {get; set; } + + /// + /// Gets or sets the auto-startup schedule, if one has been set at the lab or + /// lab resource level. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVmsStartup")] + public ScheduleFragment LabVmsStartup {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplyArtifactsRequest.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplyArtifactsRequest.cs index c82aca03f27c..b57d59b978f2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplyArtifactsRequest.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplyArtifactsRequest.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public ApplyArtifactsRequest() /// /// Initializes a new instance of the ApplyArtifactsRequest class. /// - /// The list of artifacts to apply. - public ApplyArtifactsRequest(IList artifacts = default(IList)) + + /// The list of artifacts to apply. + /// + public ApplyArtifactsRequest(System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList)) + { - Artifacts = artifacts; + this.Artifacts = artifacts; CustomInit(); } @@ -43,11 +38,11 @@ public ApplyArtifactsRequest() /// partial void CustomInit(); + /// /// Gets or sets the list of artifacts to apply. /// - [JsonProperty(PropertyName = "artifacts")] - public IList Artifacts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplate.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplate.cs index 7afb6ed6171b..f7b48e1c0d75 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplate.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplate.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// An Azure Resource Manager template. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ArmTemplate : Resource { /// @@ -34,33 +24,54 @@ public ArmTemplate() /// /// Initializes a new instance of the ArmTemplate class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The display name of the ARM - /// template. - /// The description of the ARM - /// template. - /// The publisher of the ARM template. - /// The URI to the icon of the ARM template. - /// The contents of the ARM template. - /// The creation date of the - /// armTemplate. - /// File name and parameter - /// values information from all azuredeploy.*.parameters.json for the - /// ARM template. - public ArmTemplate(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), string publisher = default(string), string icon = default(string), object contents = default(object), System.DateTime? createdDate = default(System.DateTime?), IList parametersValueFilesInfo = default(IList)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The display name of the ARM template. + /// + + /// The description of the ARM template. + /// + + /// The publisher of the ARM template. + /// + + /// The URI to the icon of the ARM template. + /// + + /// The contents of the ARM template. + /// + + /// The creation date of the armTemplate. + /// + + /// File name and parameter values information from all + /// azuredeploy.*.parameters.json for the ARM template. + /// + public ArmTemplate(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), string displayName = default(string), string description = default(string), string publisher = default(string), string icon = default(string), object contents = default(object), System.DateTime? createdDate = default(System.DateTime?), System.Collections.Generic.IList parametersValueFilesInfo = default(System.Collections.Generic.IList)) + + : base(id, name, type, location, tags) { - DisplayName = displayName; - Description = description; - Publisher = publisher; - Icon = icon; - Contents = contents; - CreatedDate = createdDate; - ParametersValueFilesInfo = parametersValueFilesInfo; + this.DisplayName = displayName; + this.Description = description; + this.Publisher = publisher; + this.Icon = icon; + this.Contents = contents; + this.CreatedDate = createdDate; + this.ParametersValueFilesInfo = parametersValueFilesInfo; CustomInit(); } @@ -69,48 +80,48 @@ public ArmTemplate() /// partial void CustomInit(); + /// /// Gets the display name of the ARM template. /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName {get; private set; } /// /// Gets the description of the ARM template. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; private set; } /// /// Gets the publisher of the ARM template. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; private set; } /// /// Gets the URI to the icon of the ARM template. /// - [JsonProperty(PropertyName = "properties.icon")] - public string Icon { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.icon")] + public string Icon {get; private set; } /// /// Gets the contents of the ARM template. /// - [JsonProperty(PropertyName = "properties.contents")] - public object Contents { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.contents")] + public object Contents {get; private set; } /// /// Gets the creation date of the armTemplate. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets file name and parameter values information from all /// azuredeploy.*.parameters.json for the ARM template. /// - [JsonProperty(PropertyName = "properties.parametersValueFilesInfo")] - public IList ParametersValueFilesInfo { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parametersValueFilesInfo")] + public System.Collections.Generic.IList ParametersValueFilesInfo {get; private set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateInfo.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateInfo.cs index 4ebb200ef3f5..dcd76c3fc811 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateInfo.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateInfo.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ArmTemplateInfo() /// /// Initializes a new instance of the ArmTemplateInfo class. /// - /// The template's contents. - /// The parameters of the ARM - /// template. + + /// The template's contents. + /// + + /// The parameters of the ARM template. + /// public ArmTemplateInfo(object template = default(object), object parameters = default(object)) + { - Template = template; - Parameters = parameters; + this.Template = template; + this.Parameters = parameters; CustomInit(); } @@ -44,17 +42,17 @@ public ArmTemplateInfo() /// partial void CustomInit(); + /// - /// Gets or sets the template's contents. + /// Gets or sets the template's contents. /// - [JsonProperty(PropertyName = "template")] - public object Template { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "template")] + public object Template {get; set; } /// /// Gets or sets the parameters of the ARM template. /// - [JsonProperty(PropertyName = "parameters")] - public object Parameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public object Parameters {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateParameterProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateParameterProperties.cs index 90cfd5cb7d46..28d96e8793cd 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateParameterProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateParameterProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ArmTemplateParameterProperties { /// - /// Initializes a new instance of the ArmTemplateParameterProperties - /// class. + /// Initializes a new instance of the ArmTemplateParameterProperties class. /// public ArmTemplateParameterProperties() { @@ -28,15 +21,19 @@ public ArmTemplateParameterProperties() } /// - /// Initializes a new instance of the ArmTemplateParameterProperties - /// class. + /// Initializes a new instance of the ArmTemplateParameterProperties class. /// - /// The name of the template parameter. - /// The value of the template parameter. + + /// The name of the template parameter. + /// + + /// The value of the template parameter. + /// public ArmTemplateParameterProperties(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -45,17 +42,17 @@ public ArmTemplateParameterProperties() /// partial void CustomInit(); + /// /// Gets or sets the name of the template parameter. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value of the template parameter. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateProperties.cs new file mode 100644 index 000000000000..13780a009b2d --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateProperties.cs @@ -0,0 +1,110 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of an Azure Resource Manager template. + /// + public partial class ArmTemplateProperties + { + /// + /// Initializes a new instance of the ArmTemplateProperties class. + /// + public ArmTemplateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmTemplateProperties class. + /// + + /// The display name of the ARM template. + /// + + /// The description of the ARM template. + /// + + /// The publisher of the ARM template. + /// + + /// The URI to the icon of the ARM template. + /// + + /// The contents of the ARM template. + /// + + /// The creation date of the armTemplate. + /// + + /// File name and parameter values information from all + /// azuredeploy.*.parameters.json for the ARM template. + /// + public ArmTemplateProperties(string displayName = default(string), string description = default(string), string publisher = default(string), string icon = default(string), object contents = default(object), System.DateTime? createdDate = default(System.DateTime?), System.Collections.Generic.IList parametersValueFilesInfo = default(System.Collections.Generic.IList)) + + { + this.DisplayName = displayName; + this.Description = description; + this.Publisher = publisher; + this.Icon = icon; + this.Contents = contents; + this.CreatedDate = createdDate; + this.ParametersValueFilesInfo = parametersValueFilesInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the display name of the ARM template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; private set; } + + /// + /// Gets the description of the ARM template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; private set; } + + /// + /// Gets the publisher of the ARM template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; private set; } + + /// + /// Gets the URI to the icon of the ARM template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "icon")] + public string Icon {get; private set; } + + /// + /// Gets the contents of the ARM template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "contents")] + public object Contents {get; private set; } + + /// + /// Gets the creation date of the armTemplate. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets file name and parameter values information from all + /// azuredeploy.*.parameters.json for the ARM template. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parametersValueFilesInfo")] + public System.Collections.Generic.IList ParametersValueFilesInfo {get; private set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Artifact.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Artifact.cs index 348308a7d0f9..32b008c44b96 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Artifact.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Artifact.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// An artifact. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Artifact : Resource { /// @@ -34,30 +24,57 @@ public Artifact() /// /// Initializes a new instance of the Artifact class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The artifact's title. - /// The artifact's description. - /// The artifact's publisher. - /// The file path to the artifact. - /// The URI to the artifact icon. - /// The artifact's target OS. - /// The artifact's parameters. - /// The artifact's creation date. - public Artifact(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string title = default(string), string description = default(string), string publisher = default(string), string filePath = default(string), string icon = default(string), string targetOsType = default(string), object parameters = default(object), System.DateTime? createdDate = default(System.DateTime?)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The artifact's title. + /// + + /// The artifact's description. + /// + + /// The artifact's publisher. + /// + + /// The file path to the artifact. + /// + + /// The URI to the artifact icon. + /// + + /// The artifact's target OS. + /// + + /// The artifact's parameters. + /// + + /// The artifact's creation date. + /// + public Artifact(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), string title = default(string), string description = default(string), string publisher = default(string), string filePath = default(string), string icon = default(string), string targetOSType = default(string), object parameters = default(object), System.DateTime? createdDate = default(System.DateTime?)) + + : base(id, name, type, location, tags) { - Title = title; - Description = description; - Publisher = publisher; - FilePath = filePath; - Icon = icon; - TargetOsType = targetOsType; - Parameters = parameters; - CreatedDate = createdDate; + this.Title = title; + this.Description = description; + this.Publisher = publisher; + this.FilePath = filePath; + this.Icon = icon; + this.TargetOSType = targetOSType; + this.Parameters = parameters; + this.CreatedDate = createdDate; CustomInit(); } @@ -66,53 +83,53 @@ public Artifact() /// partial void CustomInit(); + /// - /// Gets the artifact's title. + /// Gets the artifact's title. /// - [JsonProperty(PropertyName = "properties.title")] - public string Title { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.title")] + public string Title {get; private set; } /// - /// Gets the artifact's description. + /// Gets the artifact's description. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; private set; } /// - /// Gets the artifact's publisher. + /// Gets the artifact's publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; private set; } /// /// Gets the file path to the artifact. /// - [JsonProperty(PropertyName = "properties.filePath")] - public string FilePath { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.filePath")] + public string FilePath {get; private set; } /// /// Gets the URI to the artifact icon. /// - [JsonProperty(PropertyName = "properties.icon")] - public string Icon { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.icon")] + public string Icon {get; private set; } /// - /// Gets the artifact's target OS. + /// Gets the artifact's target OS. /// - [JsonProperty(PropertyName = "properties.targetOsType")] - public string TargetOsType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetOsType")] + public string TargetOSType {get; private set; } /// - /// Gets the artifact's parameters. + /// Gets the artifact's parameters. /// - [JsonProperty(PropertyName = "properties.parameters")] - public object Parameters { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parameters")] + public object Parameters {get; private set; } /// - /// Gets the artifact's creation date. + /// Gets the artifact's creation date. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusProperties.cs index 608decf38634..68376efc98b1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ArtifactDeploymentStatusProperties { /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusProperties class. + /// Initializes a new instance of the ArtifactDeploymentStatusProperties class. /// public ArtifactDeploymentStatusProperties() { @@ -28,20 +21,23 @@ public ArtifactDeploymentStatusProperties() } /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusProperties class. + /// Initializes a new instance of the ArtifactDeploymentStatusProperties class. /// - /// The deployment status of the - /// artifact. - /// The total count of the artifacts - /// that were successfully applied. - /// The total count of the artifacts that - /// were tentatively applied. + + /// The deployment status of the artifact. + /// + + /// The total count of the artifacts that were successfully applied. + /// + + /// The total count of the artifacts that were tentatively applied. + /// public ArtifactDeploymentStatusProperties(string deploymentStatus = default(string), int? artifactsApplied = default(int?), int? totalArtifacts = default(int?)) + { - DeploymentStatus = deploymentStatus; - ArtifactsApplied = artifactsApplied; - TotalArtifacts = totalArtifacts; + this.DeploymentStatus = deploymentStatus; + this.ArtifactsApplied = artifactsApplied; + this.TotalArtifacts = totalArtifacts; CustomInit(); } @@ -50,25 +46,25 @@ public ArtifactDeploymentStatusProperties() /// partial void CustomInit(); + /// /// Gets or sets the deployment status of the artifact. /// - [JsonProperty(PropertyName = "deploymentStatus")] - public string DeploymentStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentStatus")] + public string DeploymentStatus {get; set; } /// - /// Gets or sets the total count of the artifacts that were - /// successfully applied. + /// Gets or sets the total count of the artifacts that were successfully + /// applied. /// - [JsonProperty(PropertyName = "artifactsApplied")] - public int? ArtifactsApplied { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactsApplied")] + public int? ArtifactsApplied {get; set; } /// /// Gets or sets the total count of the artifacts that were tentatively /// applied. /// - [JsonProperty(PropertyName = "totalArtifacts")] - public int? TotalArtifacts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "totalArtifacts")] + public int? TotalArtifacts {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs index 6e4e03c72765..240a4ea20ab8 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ArtifactDeploymentStatusPropertiesFragment { /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusPropertiesFragment class. + /// Initializes a new instance of the ArtifactDeploymentStatusPropertiesFragment class. /// public ArtifactDeploymentStatusPropertiesFragment() { @@ -28,20 +21,23 @@ public ArtifactDeploymentStatusPropertiesFragment() } /// - /// Initializes a new instance of the - /// ArtifactDeploymentStatusPropertiesFragment class. + /// Initializes a new instance of the ArtifactDeploymentStatusPropertiesFragment class. /// - /// The deployment status of the - /// artifact. - /// The total count of the artifacts - /// that were successfully applied. - /// The total count of the artifacts that - /// were tentatively applied. + + /// The deployment status of the artifact. + /// + + /// The total count of the artifacts that were successfully applied. + /// + + /// The total count of the artifacts that were tentatively applied. + /// public ArtifactDeploymentStatusPropertiesFragment(string deploymentStatus = default(string), int? artifactsApplied = default(int?), int? totalArtifacts = default(int?)) + { - DeploymentStatus = deploymentStatus; - ArtifactsApplied = artifactsApplied; - TotalArtifacts = totalArtifacts; + this.DeploymentStatus = deploymentStatus; + this.ArtifactsApplied = artifactsApplied; + this.TotalArtifacts = totalArtifacts; CustomInit(); } @@ -50,25 +46,25 @@ public ArtifactDeploymentStatusPropertiesFragment() /// partial void CustomInit(); + /// /// Gets or sets the deployment status of the artifact. /// - [JsonProperty(PropertyName = "deploymentStatus")] - public string DeploymentStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentStatus")] + public string DeploymentStatus {get; set; } /// - /// Gets or sets the total count of the artifacts that were - /// successfully applied. + /// Gets or sets the total count of the artifacts that were successfully + /// applied. /// - [JsonProperty(PropertyName = "artifactsApplied")] - public int? ArtifactsApplied { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactsApplied")] + public int? ArtifactsApplied {get; set; } /// /// Gets or sets the total count of the artifacts that were tentatively /// applied. /// - [JsonProperty(PropertyName = "totalArtifacts")] - public int? TotalArtifacts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "totalArtifacts")] + public int? TotalArtifacts {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallProperties.cs index 549835c1abc1..60f0128c3534 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,23 +23,33 @@ public ArtifactInstallProperties() /// /// Initializes a new instance of the ArtifactInstallProperties class. /// - /// The artifact's identifier. - /// The parameters of the artifact. - /// The status of the artifact. - /// The status message from the - /// deployment. - /// The status message from the - /// virtual machine extension. - /// The time that the artifact starts to - /// install on the virtual machine. - public ArtifactInstallProperties(string artifactId = default(string), IList parameters = default(IList), string status = default(string), string deploymentStatusMessage = default(string), string vmExtensionStatusMessage = default(string), System.DateTime? installTime = default(System.DateTime?)) + + /// The artifact's identifier. + /// + + /// The parameters of the artifact. + /// + + /// The status of the artifact. + /// + + /// The status message from the deployment. + /// + + /// The status message from the virtual machine extension. + /// + + /// The time that the artifact starts to install on the virtual machine. + /// + public ArtifactInstallProperties(string artifactId = default(string), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList), string status = default(string), string deploymentStatusMessage = default(string), string vmExtensionStatusMessage = default(string), System.DateTime? installTime = default(System.DateTime?)) + { - ArtifactId = artifactId; - Parameters = parameters; - Status = status; - DeploymentStatusMessage = deploymentStatusMessage; - VmExtensionStatusMessage = vmExtensionStatusMessage; - InstallTime = installTime; + this.ArtifactId = artifactId; + this.Parameters = parameters; + this.Status = status; + this.DeploymentStatusMessage = deploymentStatusMessage; + this.VMExtensionStatusMessage = vmExtensionStatusMessage; + this.InstallTime = installTime; CustomInit(); } @@ -56,42 +58,42 @@ public ArtifactInstallProperties() /// partial void CustomInit(); + /// - /// Gets or sets the artifact's identifier. + /// Gets or sets the artifact's identifier. /// - [JsonProperty(PropertyName = "artifactId")] - public string ArtifactId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactId")] + public string ArtifactId {get; set; } /// /// Gets or sets the parameters of the artifact. /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Gets or sets the status of the artifact. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the status message from the deployment. /// - [JsonProperty(PropertyName = "deploymentStatusMessage")] - public string DeploymentStatusMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentStatusMessage")] + public string DeploymentStatusMessage {get; set; } /// /// Gets or sets the status message from the virtual machine extension. /// - [JsonProperty(PropertyName = "vmExtensionStatusMessage")] - public string VmExtensionStatusMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmExtensionStatusMessage")] + public string VMExtensionStatusMessage {get; set; } /// - /// Gets or sets the time that the artifact starts to install on the - /// virtual machine. + /// Gets or sets the time that the artifact starts to install on the virtual + /// machine. /// - [JsonProperty(PropertyName = "installTime")] - public System.DateTime? InstallTime { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "installTime")] + public System.DateTime? InstallTime {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallPropertiesFragment.cs index 1ed69b046199..1318fbef13c5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallPropertiesFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallPropertiesFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ArtifactInstallPropertiesFragment { /// - /// Initializes a new instance of the ArtifactInstallPropertiesFragment - /// class. + /// Initializes a new instance of the ArtifactInstallPropertiesFragment class. /// public ArtifactInstallPropertiesFragment() { @@ -30,26 +21,35 @@ public ArtifactInstallPropertiesFragment() } /// - /// Initializes a new instance of the ArtifactInstallPropertiesFragment - /// class. + /// Initializes a new instance of the ArtifactInstallPropertiesFragment class. /// - /// The artifact's identifier. - /// The parameters of the artifact. - /// The status of the artifact. - /// The status message from the - /// deployment. - /// The status message from the - /// virtual machine extension. - /// The time that the artifact starts to - /// install on the virtual machine. - public ArtifactInstallPropertiesFragment(string artifactId = default(string), IList parameters = default(IList), string status = default(string), string deploymentStatusMessage = default(string), string vmExtensionStatusMessage = default(string), System.DateTime? installTime = default(System.DateTime?)) + + /// The artifact's identifier. + /// + + /// The parameters of the artifact. + /// + + /// The status of the artifact. + /// + + /// The status message from the deployment. + /// + + /// The status message from the virtual machine extension. + /// + + /// The time that the artifact starts to install on the virtual machine. + /// + public ArtifactInstallPropertiesFragment(string artifactId = default(string), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList), string status = default(string), string deploymentStatusMessage = default(string), string vmExtensionStatusMessage = default(string), System.DateTime? installTime = default(System.DateTime?)) + { - ArtifactId = artifactId; - Parameters = parameters; - Status = status; - DeploymentStatusMessage = deploymentStatusMessage; - VmExtensionStatusMessage = vmExtensionStatusMessage; - InstallTime = installTime; + this.ArtifactId = artifactId; + this.Parameters = parameters; + this.Status = status; + this.DeploymentStatusMessage = deploymentStatusMessage; + this.VMExtensionStatusMessage = vmExtensionStatusMessage; + this.InstallTime = installTime; CustomInit(); } @@ -58,42 +58,42 @@ public ArtifactInstallPropertiesFragment() /// partial void CustomInit(); + /// - /// Gets or sets the artifact's identifier. + /// Gets or sets the artifact's identifier. /// - [JsonProperty(PropertyName = "artifactId")] - public string ArtifactId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactId")] + public string ArtifactId {get; set; } /// /// Gets or sets the parameters of the artifact. /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Gets or sets the status of the artifact. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the status message from the deployment. /// - [JsonProperty(PropertyName = "deploymentStatusMessage")] - public string DeploymentStatusMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentStatusMessage")] + public string DeploymentStatusMessage {get; set; } /// /// Gets or sets the status message from the virtual machine extension. /// - [JsonProperty(PropertyName = "vmExtensionStatusMessage")] - public string VmExtensionStatusMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmExtensionStatusMessage")] + public string VMExtensionStatusMessage {get; set; } /// - /// Gets or sets the time that the artifact starts to install on the - /// virtual machine. + /// Gets or sets the time that the artifact starts to install on the virtual + /// machine. /// - [JsonProperty(PropertyName = "installTime")] - public System.DateTime? InstallTime { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "installTime")] + public System.DateTime? InstallTime {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterProperties.cs index 1da54a237f25..97c6907499a8 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ArtifactParameterProperties { /// - /// Initializes a new instance of the ArtifactParameterProperties - /// class. + /// Initializes a new instance of the ArtifactParameterProperties class. /// public ArtifactParameterProperties() { @@ -28,15 +21,19 @@ public ArtifactParameterProperties() } /// - /// Initializes a new instance of the ArtifactParameterProperties - /// class. + /// Initializes a new instance of the ArtifactParameterProperties class. /// - /// The name of the artifact parameter. - /// The value of the artifact parameter. + + /// The name of the artifact parameter. + /// + + /// The value of the artifact parameter. + /// public ArtifactParameterProperties(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -45,17 +42,17 @@ public ArtifactParameterProperties() /// partial void CustomInit(); + /// /// Gets or sets the name of the artifact parameter. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value of the artifact parameter. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterPropertiesFragment.cs index 991965a21d01..1c959a47396e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterPropertiesFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterPropertiesFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ArtifactParameterPropertiesFragment { /// - /// Initializes a new instance of the - /// ArtifactParameterPropertiesFragment class. + /// Initializes a new instance of the ArtifactParameterPropertiesFragment class. /// public ArtifactParameterPropertiesFragment() { @@ -28,15 +21,19 @@ public ArtifactParameterPropertiesFragment() } /// - /// Initializes a new instance of the - /// ArtifactParameterPropertiesFragment class. + /// Initializes a new instance of the ArtifactParameterPropertiesFragment class. /// - /// The name of the artifact parameter. - /// The value of the artifact parameter. + + /// The name of the artifact parameter. + /// + + /// The value of the artifact parameter. + /// public ArtifactParameterPropertiesFragment(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -45,17 +42,17 @@ public ArtifactParameterPropertiesFragment() /// partial void CustomInit(); + /// /// Gets or sets the name of the artifact parameter. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value of the artifact parameter. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactProperties.cs new file mode 100644 index 000000000000..763a9b91784f --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactProperties.cs @@ -0,0 +1,118 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of an artifact. + /// + public partial class ArtifactProperties + { + /// + /// Initializes a new instance of the ArtifactProperties class. + /// + public ArtifactProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArtifactProperties class. + /// + + /// The artifact's title. + /// + + /// The artifact's description. + /// + + /// The artifact's publisher. + /// + + /// The file path to the artifact. + /// + + /// The URI to the artifact icon. + /// + + /// The artifact's target OS. + /// + + /// The artifact's parameters. + /// + + /// The artifact's creation date. + /// + public ArtifactProperties(string title = default(string), string description = default(string), string publisher = default(string), string filePath = default(string), string icon = default(string), string targetOSType = default(string), object parameters = default(object), System.DateTime? createdDate = default(System.DateTime?)) + + { + this.Title = title; + this.Description = description; + this.Publisher = publisher; + this.FilePath = filePath; + this.Icon = icon; + this.TargetOSType = targetOSType; + this.Parameters = parameters; + this.CreatedDate = createdDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the artifact's title. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "title")] + public string Title {get; private set; } + + /// + /// Gets the artifact's description. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; private set; } + + /// + /// Gets the artifact's publisher. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; private set; } + + /// + /// Gets the file path to the artifact. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "filePath")] + public string FilePath {get; private set; } + + /// + /// Gets the URI to the artifact icon. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "icon")] + public string Icon {get; private set; } + + /// + /// Gets the artifact's target OS. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetOsType")] + public string TargetOSType {get; private set; } + + /// + /// Gets the artifact's parameters. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public object Parameters {get; private set; } + + /// + /// Gets the artifact's creation date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSource.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSource.cs index fc8cc3fe327e..17ee83e3d8a1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSource.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSource.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Properties of an artifact source. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ArtifactSource : Resource { /// @@ -34,46 +24,69 @@ public ArtifactSource() /// /// Initializes a new instance of the ArtifactSource class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The artifact source's display - /// name. - /// The artifact source's URI. - /// The artifact source's type. Possible - /// values include: 'VsoGit', 'GitHub' - /// The folder containing artifacts. - /// The folder containing Azure - /// Resource Manager templates. - /// The artifact source's branch - /// reference. - /// The security token to authenticate to - /// the artifact source. - /// Indicates if the artifact source is enabled - /// (values: Enabled, Disabled). Possible values include: 'Enabled', - /// 'Disabled' - /// The artifact source's creation - /// date. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public ArtifactSource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The artifact source's display name. + /// + + /// The artifact source's URI. + /// + + /// The artifact source's type. + /// Possible values include: 'VsoGit', 'GitHub' + + /// The folder containing artifacts. + /// + + /// The folder containing Azure Resource Manager templates. + /// + + /// The artifact source's branch reference. + /// + + /// The security token to authenticate to the artifact source. + /// + + /// Indicates if the artifact source is enabled (values: Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + + /// The artifact source's creation date. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public ArtifactSource(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), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - DisplayName = displayName; - Uri = uri; - SourceType = sourceType; - FolderPath = folderPath; - ArmTemplateFolderPath = armTemplateFolderPath; - BranchRef = branchRef; - SecurityToken = securityToken; - Status = status; - CreatedDate = createdDate; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.DisplayName = displayName; + this.Uri = uri; + this.SourceType = sourceType; + this.FolderPath = folderPath; + this.ArmTemplateFolderPath = armTemplateFolderPath; + this.BranchRef = branchRef; + this.SecurityToken = securityToken; + this.Status = status; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -82,75 +95,72 @@ public ArtifactSource() /// partial void CustomInit(); + /// - /// Gets or sets the artifact source's display name. + /// Gets or sets the artifact source's display name. /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName {get; set; } /// - /// Gets or sets the artifact source's URI. + /// Gets or sets the artifact source's URI. /// - [JsonProperty(PropertyName = "properties.uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uri")] + public string Uri {get; set; } /// - /// Gets or sets the artifact source's type. Possible values include: - /// 'VsoGit', 'GitHub' + /// Gets or sets the artifact source's type. Possible values include: 'VsoGit', 'GitHub' /// - [JsonProperty(PropertyName = "properties.sourceType")] - public string SourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceType")] + public string SourceType {get; set; } /// /// Gets or sets the folder containing artifacts. /// - [JsonProperty(PropertyName = "properties.folderPath")] - public string FolderPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.folderPath")] + public string FolderPath {get; set; } /// - /// Gets or sets the folder containing Azure Resource Manager - /// templates. + /// Gets or sets the folder containing Azure Resource Manager templates. /// - [JsonProperty(PropertyName = "properties.armTemplateFolderPath")] - public string ArmTemplateFolderPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.armTemplateFolderPath")] + public string ArmTemplateFolderPath {get; set; } /// - /// Gets or sets the artifact source's branch reference. + /// Gets or sets the artifact source's branch reference. /// - [JsonProperty(PropertyName = "properties.branchRef")] - public string BranchRef { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.branchRef")] + public string BranchRef {get; set; } /// - /// Gets or sets the security token to authenticate to the artifact - /// source. + /// Gets or sets the security token to authenticate to the artifact source. /// - [JsonProperty(PropertyName = "properties.securityToken")] - public string SecurityToken { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityToken")] + public string SecurityToken {get; set; } /// - /// Gets or sets indicates if the artifact source is enabled (values: - /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// Gets or sets indicates if the artifact source is enabled (values: Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public string Status {get; set; } /// - /// Gets the artifact source's creation date. + /// Gets the artifact source's creation date. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceFragment.cs index f4b5624edf83..7af813d79430 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Properties of an artifact source. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ArtifactSourceFragment : Resource { /// @@ -34,43 +24,65 @@ public ArtifactSourceFragment() /// /// Initializes a new instance of the ArtifactSourceFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The artifact source's display - /// name. - /// The artifact source's URI. - /// The artifact source's type. Possible - /// values include: 'VsoGit', 'GitHub' - /// The folder containing artifacts. - /// The folder containing Azure - /// Resource Manager templates. - /// The artifact source's branch - /// reference. - /// The security token to authenticate to - /// the artifact source. - /// Indicates if the artifact source is enabled - /// (values: Enabled, Disabled). Possible values include: 'Enabled', - /// 'Disabled' - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public ArtifactSourceFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The artifact source's display name. + /// + + /// The artifact source's URI. + /// + + /// The artifact source's type. + /// Possible values include: 'VsoGit', 'GitHub' + + /// The folder containing artifacts. + /// + + /// The folder containing Azure Resource Manager templates. + /// + + /// The artifact source's branch reference. + /// + + /// The security token to authenticate to the artifact source. + /// + + /// Indicates if the artifact source is enabled (values: Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public ArtifactSourceFragment(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), string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - DisplayName = displayName; - Uri = uri; - SourceType = sourceType; - FolderPath = folderPath; - ArmTemplateFolderPath = armTemplateFolderPath; - BranchRef = branchRef; - SecurityToken = securityToken; - Status = status; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.DisplayName = displayName; + this.Uri = uri; + this.SourceType = sourceType; + this.FolderPath = folderPath; + this.ArmTemplateFolderPath = armTemplateFolderPath; + this.BranchRef = branchRef; + this.SecurityToken = securityToken; + this.Status = status; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -79,69 +91,66 @@ public ArtifactSourceFragment() /// partial void CustomInit(); + /// - /// Gets or sets the artifact source's display name. + /// Gets or sets the artifact source's display name. /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName {get; set; } /// - /// Gets or sets the artifact source's URI. + /// Gets or sets the artifact source's URI. /// - [JsonProperty(PropertyName = "properties.uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uri")] + public string Uri {get; set; } /// - /// Gets or sets the artifact source's type. Possible values include: - /// 'VsoGit', 'GitHub' + /// Gets or sets the artifact source's type. Possible values include: 'VsoGit', 'GitHub' /// - [JsonProperty(PropertyName = "properties.sourceType")] - public string SourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceType")] + public string SourceType {get; set; } /// /// Gets or sets the folder containing artifacts. /// - [JsonProperty(PropertyName = "properties.folderPath")] - public string FolderPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.folderPath")] + public string FolderPath {get; set; } /// - /// Gets or sets the folder containing Azure Resource Manager - /// templates. + /// Gets or sets the folder containing Azure Resource Manager templates. /// - [JsonProperty(PropertyName = "properties.armTemplateFolderPath")] - public string ArmTemplateFolderPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.armTemplateFolderPath")] + public string ArmTemplateFolderPath {get; set; } /// - /// Gets or sets the artifact source's branch reference. + /// Gets or sets the artifact source's branch reference. /// - [JsonProperty(PropertyName = "properties.branchRef")] - public string BranchRef { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.branchRef")] + public string BranchRef {get; set; } /// - /// Gets or sets the security token to authenticate to the artifact - /// source. + /// Gets or sets the security token to authenticate to the artifact source. /// - [JsonProperty(PropertyName = "properties.securityToken")] - public string SecurityToken { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityToken")] + public string SecurityToken {get; set; } /// - /// Gets or sets indicates if the artifact source is enabled (values: - /// Enabled, Disabled). Possible values include: 'Enabled', 'Disabled' + /// Gets or sets indicates if the artifact source is enabled (values: Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public string Status {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceProperties.cs new file mode 100644 index 000000000000..280e7f305ea8 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceProperties.cs @@ -0,0 +1,149 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of an artifact source. + /// + public partial class ArtifactSourceProperties + { + /// + /// Initializes a new instance of the ArtifactSourceProperties class. + /// + public ArtifactSourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArtifactSourceProperties class. + /// + + /// The artifact source's display name. + /// + + /// The artifact source's URI. + /// + + /// The artifact source's type. + /// Possible values include: 'VsoGit', 'GitHub' + + /// The folder containing artifacts. + /// + + /// The folder containing Azure Resource Manager templates. + /// + + /// The artifact source's branch reference. + /// + + /// The security token to authenticate to the artifact source. + /// + + /// Indicates if the artifact source is enabled (values: Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + + /// The artifact source's creation date. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public ArtifactSourceProperties(string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.DisplayName = displayName; + this.Uri = uri; + this.SourceType = sourceType; + this.FolderPath = folderPath; + this.ArmTemplateFolderPath = armTemplateFolderPath; + this.BranchRef = branchRef; + this.SecurityToken = securityToken; + this.Status = status; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the artifact source's display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the artifact source's URI. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } + + /// + /// Gets or sets the artifact source's type. Possible values include: 'VsoGit', 'GitHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceType")] + public string SourceType {get; set; } + + /// + /// Gets or sets the folder containing artifacts. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "folderPath")] + public string FolderPath {get; set; } + + /// + /// Gets or sets the folder containing Azure Resource Manager templates. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "armTemplateFolderPath")] + public string ArmTemplateFolderPath {get; set; } + + /// + /// Gets or sets the artifact source's branch reference. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "branchRef")] + public string BranchRef {get; set; } + + /// + /// Gets or sets the security token to authenticate to the artifact source. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityToken")] + public string SecurityToken {get; set; } + + /// + /// Gets or sets indicates if the artifact source is enabled (values: Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets the artifact source's creation date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourcePropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourcePropertiesFragment.cs new file mode 100644 index 000000000000..50498aad0eeb --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourcePropertiesFragment.cs @@ -0,0 +1,139 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of an artifact source. + /// + public partial class ArtifactSourcePropertiesFragment + { + /// + /// Initializes a new instance of the ArtifactSourcePropertiesFragment class. + /// + public ArtifactSourcePropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArtifactSourcePropertiesFragment class. + /// + + /// The artifact source's display name. + /// + + /// The artifact source's URI. + /// + + /// The artifact source's type. + /// Possible values include: 'VsoGit', 'GitHub' + + /// The folder containing artifacts. + /// + + /// The folder containing Azure Resource Manager templates. + /// + + /// The artifact source's branch reference. + /// + + /// The security token to authenticate to the artifact source. + /// + + /// Indicates if the artifact source is enabled (values: Enabled, Disabled). + /// Possible values include: 'Enabled', 'Disabled' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public ArtifactSourcePropertiesFragment(string displayName = default(string), string uri = default(string), string sourceType = default(string), string folderPath = default(string), string armTemplateFolderPath = default(string), string branchRef = default(string), string securityToken = default(string), string status = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.DisplayName = displayName; + this.Uri = uri; + this.SourceType = sourceType; + this.FolderPath = folderPath; + this.ArmTemplateFolderPath = armTemplateFolderPath; + this.BranchRef = branchRef; + this.SecurityToken = securityToken; + this.Status = status; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the artifact source's display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the artifact source's URI. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } + + /// + /// Gets or sets the artifact source's type. Possible values include: 'VsoGit', 'GitHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceType")] + public string SourceType {get; set; } + + /// + /// Gets or sets the folder containing artifacts. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "folderPath")] + public string FolderPath {get; set; } + + /// + /// Gets or sets the folder containing Azure Resource Manager templates. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "armTemplateFolderPath")] + public string ArmTemplateFolderPath {get; set; } + + /// + /// Gets or sets the artifact source's branch reference. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "branchRef")] + public string BranchRef {get; set; } + + /// + /// Gets or sets the security token to authenticate to the artifact source. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityToken")] + public string SecurityToken {get; set; } + + /// + /// Gets or sets indicates if the artifact source is enabled (values: Enabled, + /// Disabled). Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachDiskProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachDiskProperties.cs index afc77e65e318..424b6d3ff734 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachDiskProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachDiskProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public AttachDiskProperties() /// /// Initializes a new instance of the AttachDiskProperties class. /// - /// The resource ID of the Lab virtual - /// machine to which the disk is attached. - public AttachDiskProperties(string leasedByLabVmId = default(string)) + + /// The resource ID of the Lab virtual machine to which the disk is attached. + /// + public AttachDiskProperties(string leasedByLabVMId = default(string)) + { - LeasedByLabVmId = leasedByLabVmId; + this.LeasedByLabVMId = leasedByLabVMId; CustomInit(); } @@ -42,12 +38,12 @@ public AttachDiskProperties() /// partial void CustomInit(); + /// - /// Gets or sets the resource ID of the Lab virtual machine to which - /// the disk is attached. + /// Gets or sets the resource ID of the Lab virtual machine to which the disk + /// is attached. /// - [JsonProperty(PropertyName = "leasedByLabVmId")] - public string LeasedByLabVmId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "leasedByLabVmId")] + public string LeasedByLabVMId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachNewDataDiskOptions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachNewDataDiskOptions.cs index f2e0d234a8b7..8e866518ee10 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachNewDataDiskOptions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachNewDataDiskOptions.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public AttachNewDataDiskOptions() /// /// Initializes a new instance of the AttachNewDataDiskOptions class. /// - /// Size of the disk to be attached in - /// GibiBytes. - /// The name of the disk to be attached. - /// The storage type for the disk (i.e. - /// Standard, Premium). Possible values include: 'Standard', - /// 'Premium' + + /// Size of the disk to be attached in GibiBytes. + /// + + /// The name of the disk to be attached. + /// + + /// The storage type for the disk (i.e. Standard, Premium). + /// Possible values include: 'Standard', 'Premium' public AttachNewDataDiskOptions(int? diskSizeGiB = default(int?), string diskName = default(string), string diskType = default(string)) + { - DiskSizeGiB = diskSizeGiB; - DiskName = diskName; - DiskType = diskType; + this.DiskSizeGiB = diskSizeGiB; + this.DiskName = diskName; + this.DiskType = diskType; CustomInit(); } @@ -48,24 +46,23 @@ public AttachNewDataDiskOptions() /// partial void CustomInit(); + /// /// Gets or sets size of the disk to be attached in GibiBytes. /// - [JsonProperty(PropertyName = "diskSizeGiB")] - public int? DiskSizeGiB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGiB")] + public int? DiskSizeGiB {get; set; } /// /// Gets or sets the name of the disk to be attached. /// - [JsonProperty(PropertyName = "diskName")] - public string DiskName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskName")] + public string DiskName {get; set; } /// - /// Gets or sets the storage type for the disk (i.e. Standard, - /// Premium). Possible values include: 'Standard', 'Premium' + /// Gets or sets the storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium' /// - [JsonProperty(PropertyName = "diskType")] - public string DiskType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskType")] + public string DiskType {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/BulkCreationParameters.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/BulkCreationParameters.cs index 218660d8d138..bd380ccc14e2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/BulkCreationParameters.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/BulkCreationParameters.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public BulkCreationParameters() /// /// Initializes a new instance of the BulkCreationParameters class. /// - /// The number of virtual machine instances - /// to create. + + /// The number of virtual machine instances to create. + /// public BulkCreationParameters(int? instanceCount = default(int?)) + { - InstanceCount = instanceCount; + this.InstanceCount = instanceCount; CustomInit(); } @@ -42,11 +38,11 @@ public BulkCreationParameters() /// partial void CustomInit(); + /// /// Gets or sets the number of virtual machine instances to create. /// - [JsonProperty(PropertyName = "instanceCount")] - public int? InstanceCount { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceCount")] + public int? InstanceCount {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDisk.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDisk.cs index f3f4872ee9e6..a6c0980f526d 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDisk.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDisk.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public ComputeDataDisk() /// /// Initializes a new instance of the ComputeDataDisk class. /// - /// Gets data disk name. - /// When backed by a blob, the URI of underlying - /// blob. - /// When backed by managed disk, this is - /// the ID of the compute disk resource. - /// Gets data disk size in GiB. + + /// Gets data disk name. + /// + + /// When backed by a blob, the URI of underlying blob. + /// + + /// When backed by managed disk, this is the ID of the compute disk resource. + /// + + /// Gets data disk size in GiB. + /// public ComputeDataDisk(string name = default(string), string diskUri = default(string), string managedDiskId = default(string), int? diskSizeGiB = default(int?)) + { - Name = name; - DiskUri = diskUri; - ManagedDiskId = managedDiskId; - DiskSizeGiB = diskSizeGiB; + this.Name = name; + this.DiskUri = diskUri; + this.ManagedDiskId = managedDiskId; + this.DiskSizeGiB = diskSizeGiB; CustomInit(); } @@ -49,30 +50,30 @@ public ComputeDataDisk() /// partial void CustomInit(); + /// - /// Gets data disk name. + /// Gets or sets gets data disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets when backed by a blob, the URI of underlying blob. /// - [JsonProperty(PropertyName = "diskUri")] - public string DiskUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskUri")] + public string DiskUri {get; set; } /// - /// Gets or sets when backed by managed disk, this is the ID of the - /// compute disk resource. + /// Gets or sets when backed by managed disk, this is the ID of the compute + /// disk resource. /// - [JsonProperty(PropertyName = "managedDiskId")] - public string ManagedDiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDiskId")] + public string ManagedDiskId {get; set; } /// - /// Gets data disk size in GiB. + /// Gets or sets gets data disk size in GiB. /// - [JsonProperty(PropertyName = "diskSizeGiB")] - public int? DiskSizeGiB { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGiB")] + public int? DiskSizeGiB {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDiskFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDiskFragment.cs index e027e1d58dc1..7ea6f4bbf2f7 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDiskFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDiskFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public ComputeDataDiskFragment() /// /// Initializes a new instance of the ComputeDataDiskFragment class. /// - /// Gets data disk name. - /// When backed by a blob, the URI of underlying - /// blob. - /// When backed by managed disk, this is - /// the ID of the compute disk resource. - /// Gets data disk size in GiB. + + /// Gets data disk name. + /// + + /// When backed by a blob, the URI of underlying blob. + /// + + /// When backed by managed disk, this is the ID of the compute disk resource. + /// + + /// Gets data disk size in GiB. + /// public ComputeDataDiskFragment(string name = default(string), string diskUri = default(string), string managedDiskId = default(string), int? diskSizeGiB = default(int?)) + { - Name = name; - DiskUri = diskUri; - ManagedDiskId = managedDiskId; - DiskSizeGiB = diskSizeGiB; + this.Name = name; + this.DiskUri = diskUri; + this.ManagedDiskId = managedDiskId; + this.DiskSizeGiB = diskSizeGiB; CustomInit(); } @@ -49,30 +50,30 @@ public ComputeDataDiskFragment() /// partial void CustomInit(); + /// - /// Gets data disk name. + /// Gets or sets gets data disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets when backed by a blob, the URI of underlying blob. /// - [JsonProperty(PropertyName = "diskUri")] - public string DiskUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskUri")] + public string DiskUri {get; set; } /// - /// Gets or sets when backed by managed disk, this is the ID of the - /// compute disk resource. + /// Gets or sets when backed by managed disk, this is the ID of the compute + /// disk resource. /// - [JsonProperty(PropertyName = "managedDiskId")] - public string ManagedDiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDiskId")] + public string ManagedDiskId {get; set; } /// - /// Gets data disk size in GiB. + /// Gets or sets gets data disk size in GiB. /// - [JsonProperty(PropertyName = "diskSizeGiB")] - public int? DiskSizeGiB { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGiB")] + public int? DiskSizeGiB {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatus.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatus.cs index a35d64d423fa..f4245c8e4768 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatus.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatus.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ComputeVmInstanceViewStatus { /// - /// Initializes a new instance of the ComputeVmInstanceViewStatus - /// class. + /// Initializes a new instance of the ComputeVmInstanceViewStatus class. /// public ComputeVmInstanceViewStatus() { @@ -28,19 +21,23 @@ public ComputeVmInstanceViewStatus() } /// - /// Initializes a new instance of the ComputeVmInstanceViewStatus - /// class. + /// Initializes a new instance of the ComputeVmInstanceViewStatus class. /// - /// Gets the status Code. - /// Gets the short localizable label for - /// the status. - /// Gets the message associated with the - /// status. + + /// Gets the status Code. + /// + + /// Gets the short localizable label for the status. + /// + + /// Gets the message associated with the status. + /// public ComputeVmInstanceViewStatus(string code = default(string), string displayStatus = default(string), string message = default(string)) + { - Code = code; - DisplayStatus = displayStatus; - Message = message; + this.Code = code; + this.DisplayStatus = displayStatus; + this.Message = message; CustomInit(); } @@ -49,23 +46,23 @@ public ComputeVmInstanceViewStatus() /// partial void CustomInit(); + /// - /// Gets the status Code. + /// Gets or sets gets the status Code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// - /// Gets the short localizable label for the status. + /// Gets or sets gets the short localizable label for the status. /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus {get; set; } /// - /// Gets the message associated with the status. + /// Gets or sets gets the message associated with the status. /// - [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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatusFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatusFragment.cs index bfebdc27f087..c5925c31e413 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatusFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatusFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ComputeVmInstanceViewStatusFragment { /// - /// Initializes a new instance of the - /// ComputeVmInstanceViewStatusFragment class. + /// Initializes a new instance of the ComputeVmInstanceViewStatusFragment class. /// public ComputeVmInstanceViewStatusFragment() { @@ -28,19 +21,23 @@ public ComputeVmInstanceViewStatusFragment() } /// - /// Initializes a new instance of the - /// ComputeVmInstanceViewStatusFragment class. + /// Initializes a new instance of the ComputeVmInstanceViewStatusFragment class. /// - /// Gets the status Code. - /// Gets the short localizable label for - /// the status. - /// Gets the message associated with the - /// status. + + /// Gets the status Code. + /// + + /// Gets the short localizable label for the status. + /// + + /// Gets the message associated with the status. + /// public ComputeVmInstanceViewStatusFragment(string code = default(string), string displayStatus = default(string), string message = default(string)) + { - Code = code; - DisplayStatus = displayStatus; - Message = message; + this.Code = code; + this.DisplayStatus = displayStatus; + this.Message = message; CustomInit(); } @@ -49,23 +46,23 @@ public ComputeVmInstanceViewStatusFragment() /// partial void CustomInit(); + /// - /// Gets the status Code. + /// Gets or sets gets the status Code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// - /// Gets the short localizable label for the status. + /// Gets or sets gets the short localizable label for the status. /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus {get; set; } /// - /// Gets the message associated with the status. + /// Gets or sets gets the message associated with the status. /// - [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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmProperties.cs index 70ea07a87f87..38d042e5949b 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,28 +23,37 @@ public ComputeVmProperties() /// /// Initializes a new instance of the ComputeVmProperties class. /// - /// Gets the statuses of the virtual - /// machine. - /// Gets the OS type of the virtual - /// machine. - /// Gets the size of the virtual machine. - /// Gets the network interface ID of - /// the virtual machine. - /// Gets OS disk blob uri for the virtual - /// machine. - /// Gets data disks blob uri for the virtual - /// machine. - /// Gets all data disks attached to the virtual - /// machine. - public ComputeVmProperties(IList statuses = default(IList), string osType = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), IList dataDiskIds = default(IList), IList dataDisks = default(IList)) + + /// Gets the statuses of the virtual machine. + /// + + /// Gets the OS type of the virtual machine. + /// + + /// Gets the size of the virtual machine. + /// + + /// Gets the network interface ID of the virtual machine. + /// + + /// Gets OS disk blob uri for the virtual machine. + /// + + /// Gets data disks blob uri for the virtual machine. + /// + + /// Gets all data disks attached to the virtual machine. + /// + public ComputeVmProperties(System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), string osType = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), System.Collections.Generic.IList dataDiskIds = default(System.Collections.Generic.IList), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList)) + { - Statuses = statuses; - OsType = osType; - VmSize = vmSize; - NetworkInterfaceId = networkInterfaceId; - OsDiskId = osDiskId; - DataDiskIds = dataDiskIds; - DataDisks = dataDisks; + this.Statuses = statuses; + this.OSType = osType; + this.VMSize = vmSize; + this.NetworkInterfaceId = networkInterfaceId; + this.OSDiskId = osDiskId; + this.DataDiskIds = dataDiskIds; + this.DataDisks = dataDisks; CustomInit(); } @@ -61,47 +62,47 @@ public ComputeVmProperties() /// partial void CustomInit(); + /// - /// Gets the statuses of the virtual machine. + /// Gets or sets gets the statuses of the virtual machine. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } /// - /// Gets the OS type of the virtual machine. + /// Gets or sets gets the OS type of the virtual machine. /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } /// - /// Gets the size of the virtual machine. + /// Gets or sets gets the size of the virtual machine. /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + public string VMSize {get; set; } /// - /// Gets the network interface ID of the virtual machine. + /// Gets or sets gets the network interface ID of the virtual machine. /// - [JsonProperty(PropertyName = "networkInterfaceId")] - public string NetworkInterfaceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceId")] + public string NetworkInterfaceId {get; set; } /// - /// Gets OS disk blob uri for the virtual machine. + /// Gets or sets gets OS disk blob uri for the virtual machine. /// - [JsonProperty(PropertyName = "osDiskId")] - public string OsDiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskId")] + public string OSDiskId {get; set; } /// - /// Gets data disks blob uri for the virtual machine. + /// Gets or sets gets data disks blob uri for the virtual machine. /// - [JsonProperty(PropertyName = "dataDiskIds")] - public IList DataDiskIds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskIds")] + public System.Collections.Generic.IList DataDiskIds {get; set; } /// - /// Gets all data disks attached to the virtual machine. + /// Gets or sets gets all data disks attached to the virtual machine. /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmPropertiesFragment.cs index 6d1ca72339ed..ed0d26b90a49 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmPropertiesFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmPropertiesFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ComputeVmPropertiesFragment { /// - /// Initializes a new instance of the ComputeVmPropertiesFragment - /// class. + /// Initializes a new instance of the ComputeVmPropertiesFragment class. /// public ComputeVmPropertiesFragment() { @@ -30,31 +21,39 @@ public ComputeVmPropertiesFragment() } /// - /// Initializes a new instance of the ComputeVmPropertiesFragment - /// class. + /// Initializes a new instance of the ComputeVmPropertiesFragment class. /// - /// Gets the statuses of the virtual - /// machine. - /// Gets the OS type of the virtual - /// machine. - /// Gets the size of the virtual machine. - /// Gets the network interface ID of - /// the virtual machine. - /// Gets OS disk blob uri for the virtual - /// machine. - /// Gets data disks blob uri for the virtual - /// machine. - /// Gets all data disks attached to the virtual - /// machine. - public ComputeVmPropertiesFragment(IList statuses = default(IList), string osType = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), IList dataDiskIds = default(IList), IList dataDisks = default(IList)) + + /// Gets the statuses of the virtual machine. + /// + + /// Gets the OS type of the virtual machine. + /// + + /// Gets the size of the virtual machine. + /// + + /// Gets the network interface ID of the virtual machine. + /// + + /// Gets OS disk blob uri for the virtual machine. + /// + + /// Gets data disks blob uri for the virtual machine. + /// + + /// Gets all data disks attached to the virtual machine. + /// + public ComputeVmPropertiesFragment(System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), string osType = default(string), string vmSize = default(string), string networkInterfaceId = default(string), string osDiskId = default(string), System.Collections.Generic.IList dataDiskIds = default(System.Collections.Generic.IList), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList)) + { - Statuses = statuses; - OsType = osType; - VmSize = vmSize; - NetworkInterfaceId = networkInterfaceId; - OsDiskId = osDiskId; - DataDiskIds = dataDiskIds; - DataDisks = dataDisks; + this.Statuses = statuses; + this.OSType = osType; + this.VMSize = vmSize; + this.NetworkInterfaceId = networkInterfaceId; + this.OSDiskId = osDiskId; + this.DataDiskIds = dataDiskIds; + this.DataDisks = dataDisks; CustomInit(); } @@ -63,47 +62,47 @@ public ComputeVmPropertiesFragment() /// partial void CustomInit(); + /// - /// Gets the statuses of the virtual machine. + /// Gets or sets gets the statuses of the virtual machine. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } /// - /// Gets the OS type of the virtual machine. + /// Gets or sets gets the OS type of the virtual machine. /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } /// - /// Gets the size of the virtual machine. + /// Gets or sets gets the size of the virtual machine. /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + public string VMSize {get; set; } /// - /// Gets the network interface ID of the virtual machine. + /// Gets or sets gets the network interface ID of the virtual machine. /// - [JsonProperty(PropertyName = "networkInterfaceId")] - public string NetworkInterfaceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceId")] + public string NetworkInterfaceId {get; set; } /// - /// Gets OS disk blob uri for the virtual machine. + /// Gets or sets gets OS disk blob uri for the virtual machine. /// - [JsonProperty(PropertyName = "osDiskId")] - public string OsDiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskId")] + public string OSDiskId {get; set; } /// - /// Gets data disks blob uri for the virtual machine. + /// Gets or sets gets data disks blob uri for the virtual machine. /// - [JsonProperty(PropertyName = "dataDiskIds")] - public IList DataDiskIds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskIds")] + public System.Collections.Generic.IList DataDiskIds {get; set; } /// - /// Gets all data disks attached to the virtual machine. + /// Gets or sets gets all data disks attached to the virtual machine. /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdProperties.cs index 7c224fcdc91d..a880fe90b24e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,25 +23,31 @@ public CostThresholdProperties() /// /// Initializes a new instance of the CostThresholdProperties class. /// - /// The ID of the cost threshold - /// item. - /// The value of the percentage cost - /// threshold. - /// Indicates whether this threshold will - /// be displayed on cost charts. Possible values include: 'Enabled', - /// 'Disabled' - /// Indicates whether - /// notifications will be sent when this threshold is exceeded. - /// Possible values include: 'Enabled', 'Disabled' - /// Indicates the datetime when - /// notifications were last sent for this threshold. + + /// The ID of the cost threshold item. + /// + + /// The value of the percentage cost threshold. + /// + + /// Indicates whether this threshold will be displayed on cost charts. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether notifications will be sent when this threshold is + /// exceeded. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates the datetime when notifications were last sent for this + /// threshold. + /// public CostThresholdProperties(string thresholdId = default(string), PercentageCostThresholdProperties percentageThreshold = default(PercentageCostThresholdProperties), string displayOnChart = default(string), string sendNotificationWhenExceeded = default(string), string notificationSent = default(string)) + { - ThresholdId = thresholdId; - PercentageThreshold = percentageThreshold; - DisplayOnChart = displayOnChart; - SendNotificationWhenExceeded = sendNotificationWhenExceeded; - NotificationSent = notificationSent; + this.ThresholdId = thresholdId; + this.PercentageThreshold = percentageThreshold; + this.DisplayOnChart = displayOnChart; + this.SendNotificationWhenExceeded = sendNotificationWhenExceeded; + this.NotificationSent = notificationSent; CustomInit(); } @@ -56,39 +56,38 @@ public CostThresholdProperties() /// partial void CustomInit(); + /// /// Gets or sets the ID of the cost threshold item. /// - [JsonProperty(PropertyName = "thresholdId")] - public string ThresholdId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "thresholdId")] + public string ThresholdId {get; set; } /// /// Gets or sets the value of the percentage cost threshold. /// - [JsonProperty(PropertyName = "percentageThreshold")] - public PercentageCostThresholdProperties PercentageThreshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "percentageThreshold")] + public PercentageCostThresholdProperties PercentageThreshold {get; set; } /// - /// Gets or sets indicates whether this threshold will be displayed on - /// cost charts. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets indicates whether this threshold will be displayed on cost + /// charts. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "displayOnChart")] - public string DisplayOnChart { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayOnChart")] + public string DisplayOnChart {get; set; } /// /// Gets or sets indicates whether notifications will be sent when this - /// threshold is exceeded. Possible values include: 'Enabled', - /// 'Disabled' + /// threshold is exceeded. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "sendNotificationWhenExceeded")] - public string SendNotificationWhenExceeded { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sendNotificationWhenExceeded")] + public string SendNotificationWhenExceeded {get; set; } /// - /// Gets or sets indicates the datetime when notifications were last - /// sent for this threshold. + /// Gets or sets indicates the datetime when notifications were last sent for + /// this threshold. /// - [JsonProperty(PropertyName = "notificationSent")] - public string NotificationSent { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "notificationSent")] + public string NotificationSent {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdStatus.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdStatus.cs index 044427749abb..88da50235131 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdStatus.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdStatus.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for CostThresholdStatus. /// + + public static class CostThresholdStatus { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostType.cs index 3641c71fbca0..f273e65d08c9 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostType.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.DevTestLabs.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for CostType. /// + + public static class CostType { public const string Unavailable = "Unavailable"; public const string Reported = "Reported"; public const string Projected = "Projected"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImage.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImage.cs index a293da2d5257..32f87cddcf74 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImage.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImage.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A custom image. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CustomImage : Resource { /// @@ -34,37 +24,57 @@ public CustomImage() /// /// Initializes a new instance of the CustomImage class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The virtual machine from which the image is to be - /// created. - /// The VHD from which the image is to be - /// created. - /// The description of the custom - /// image. - /// The author of the custom image. - /// The creation date of the custom - /// image. - /// The Managed Image Id backing the - /// custom image. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public CustomImage(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CustomImagePropertiesFromVm vm = default(CustomImagePropertiesFromVm), CustomImagePropertiesCustom vhd = default(CustomImagePropertiesCustom), string description = default(string), string author = default(string), System.DateTime? creationDate = default(System.DateTime?), string managedImageId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The virtual machine from which the image is to be created. + /// + + /// The VHD from which the image is to be created. + /// + + /// The description of the custom image. + /// + + /// The author of the custom image. + /// + + /// The creation date of the custom image. + /// + + /// The Managed Image Id backing the custom image. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public CustomImage(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), CustomImagePropertiesFromVm vm = default(CustomImagePropertiesFromVm), CustomImagePropertiesCustom vhd = default(CustomImagePropertiesCustom), string description = default(string), string author = default(string), System.DateTime? creationDate = default(System.DateTime?), string managedImageId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Vm = vm; - Vhd = vhd; - Description = description; - Author = author; - CreationDate = creationDate; - ManagedImageId = managedImageId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.VM = vm; + this.Vhd = vhd; + this.Description = description; + this.Author = author; + this.CreationDate = creationDate; + this.ManagedImageId = managedImageId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -73,67 +83,72 @@ public CustomImage() /// partial void CustomInit(); + /// - /// Gets or sets the virtual machine from which the image is to be - /// created. + /// Gets or sets the virtual machine from which the image is to be created. /// - [JsonProperty(PropertyName = "properties.vm")] - public CustomImagePropertiesFromVm Vm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vm")] + public CustomImagePropertiesFromVm VM {get; set; } /// /// Gets or sets the VHD from which the image is to be created. /// - [JsonProperty(PropertyName = "properties.vhd")] - public CustomImagePropertiesCustom Vhd { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vhd")] + public CustomImagePropertiesCustom Vhd {get; set; } /// /// Gets or sets the description of the custom image. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// /// Gets or sets the author of the custom image. /// - [JsonProperty(PropertyName = "properties.author")] - public string Author { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.author")] + public string Author {get; set; } /// /// Gets the creation date of the custom image. /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate {get; private set; } /// /// Gets or sets the Managed Image Id backing the custom image. /// - [JsonProperty(PropertyName = "properties.managedImageId")] - public string ManagedImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.managedImageId")] + public string ManagedImageId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Vhd != null) + + if (this.Vhd != null) { - Vhd.Validate(); + this.Vhd.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageOsType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageOsType.cs index c1ea2b2f2597..0a1b1ebbc090 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageOsType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageOsType.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.DevTestLabs.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for CustomImageOsType. /// + + public static class CustomImageOsType { public const string Windows = "Windows"; public const string Linux = "Linux"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageProperties.cs new file mode 100644 index 000000000000..5c00660dbbfe --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageProperties.cs @@ -0,0 +1,137 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a custom image. + /// + public partial class CustomImageProperties + { + /// + /// Initializes a new instance of the CustomImageProperties class. + /// + public CustomImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomImageProperties class. + /// + + /// The virtual machine from which the image is to be created. + /// + + /// The VHD from which the image is to be created. + /// + + /// The description of the custom image. + /// + + /// The author of the custom image. + /// + + /// The creation date of the custom image. + /// + + /// The Managed Image Id backing the custom image. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public CustomImageProperties(CustomImagePropertiesFromVm vm = default(CustomImagePropertiesFromVm), CustomImagePropertiesCustom vhd = default(CustomImagePropertiesCustom), string description = default(string), string author = default(string), System.DateTime? creationDate = default(System.DateTime?), string managedImageId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.VM = vm; + this.Vhd = vhd; + this.Description = description; + this.Author = author; + this.CreationDate = creationDate; + this.ManagedImageId = managedImageId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the virtual machine from which the image is to be created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vm")] + public CustomImagePropertiesFromVm VM {get; set; } + + /// + /// Gets or sets the VHD from which the image is to be created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vhd")] + public CustomImagePropertiesCustom Vhd {get; set; } + + /// + /// Gets or sets the description of the custom image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the author of the custom image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "author")] + public string Author {get; set; } + + /// + /// Gets the creation date of the custom image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + public System.DateTime? CreationDate {get; private set; } + + /// + /// Gets or sets the Managed Image Id backing the custom image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managedImageId")] + public string ManagedImageId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.Vhd != null) + { + this.Vhd.Validate(); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesCustom.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesCustom.cs index fe22d2fbf1d7..03af67162266 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesCustom.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesCustom.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.DevTestLabs.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class CustomImagePropertiesCustom { /// - /// Initializes a new instance of the CustomImagePropertiesCustom - /// class. + /// Initializes a new instance of the CustomImagePropertiesCustom class. /// public CustomImagePropertiesCustom() { @@ -29,19 +21,23 @@ public CustomImagePropertiesCustom() } /// - /// Initializes a new instance of the CustomImagePropertiesCustom - /// class. + /// Initializes a new instance of the CustomImagePropertiesCustom class. /// - /// The OS type of the custom image (i.e. Windows, - /// Linux). Possible values include: 'Windows', 'Linux', 'None' - /// The image name. - /// Indicates whether sysprep has been run on the - /// VHD. + + /// The image name. + /// + + /// Indicates whether sysprep has been run on the VHD. + /// + + /// The OS type of the custom image (i.e. Windows, Linux) + /// Possible values include: 'Windows', 'Linux', 'None' public CustomImagePropertiesCustom(string osType, string imageName = default(string), bool? sysPrep = default(bool?)) + { - ImageName = imageName; - SysPrep = sysPrep; - OsType = osType; + this.ImageName = imageName; + this.SysPrep = sysPrep; + this.OSType = osType; CustomInit(); } @@ -50,37 +46,38 @@ public CustomImagePropertiesCustom() /// partial void CustomInit(); + /// /// Gets or sets the image name. /// - [JsonProperty(PropertyName = "imageName")] - public string ImageName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imageName")] + public string ImageName {get; set; } /// /// Gets or sets indicates whether sysprep has been run on the VHD. /// - [JsonProperty(PropertyName = "sysPrep")] - public bool? SysPrep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sysPrep")] + public bool? SysPrep {get; set; } /// - /// Gets or sets the OS type of the custom image (i.e. Windows, Linux). - /// Possible values include: 'Windows', 'Linux', 'None' + /// Gets or sets the OS type of the custom image (i.e. Windows, Linux) Possible values include: 'Windows', 'Linux', 'None' /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OsType == null) + if (this.OSType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OSType"); } + + } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromVm.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromVm.cs index 08b8fdce4707..88ad7d944fd9 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromVm.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromVm.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class CustomImagePropertiesFromVm { /// - /// Initializes a new instance of the CustomImagePropertiesFromVm - /// class. + /// Initializes a new instance of the CustomImagePropertiesFromVm class. /// public CustomImagePropertiesFromVm() { @@ -28,19 +21,23 @@ public CustomImagePropertiesFromVm() } /// - /// Initializes a new instance of the CustomImagePropertiesFromVm - /// class. + /// Initializes a new instance of the CustomImagePropertiesFromVm class. /// - /// The source vm identifier. - /// The Windows OS information of the - /// VM. - /// The Linux OS information of the - /// VM. - public CustomImagePropertiesFromVm(string sourceVmId = default(string), WindowsOsInfo windowsOsInfo = default(WindowsOsInfo), LinuxOsInfo linuxOsInfo = default(LinuxOsInfo)) + + /// The source vm identifier. + /// + + /// The Windows OS information of the VM. + /// + + /// The Linux OS information of the VM. + /// + public CustomImagePropertiesFromVm(string sourceVMId = default(string), WindowsOsInfo windowsOSInfo = default(WindowsOsInfo), LinuxOsInfo linuxOSInfo = default(LinuxOsInfo)) + { - SourceVmId = sourceVmId; - WindowsOsInfo = windowsOsInfo; - LinuxOsInfo = linuxOsInfo; + this.SourceVMId = sourceVMId; + this.WindowsOSInfo = windowsOSInfo; + this.LinuxOSInfo = linuxOSInfo; CustomInit(); } @@ -49,23 +46,23 @@ public CustomImagePropertiesFromVm() /// partial void CustomInit(); + /// /// Gets or sets the source vm identifier. /// - [JsonProperty(PropertyName = "sourceVmId")] - public string SourceVmId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVmId")] + public string SourceVMId {get; set; } /// /// Gets or sets the Windows OS information of the VM. /// - [JsonProperty(PropertyName = "windowsOsInfo")] - public WindowsOsInfo WindowsOsInfo { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "windowsOsInfo")] + public WindowsOsInfo WindowsOSInfo {get; set; } /// /// Gets or sets the Linux OS information of the VM. /// - [JsonProperty(PropertyName = "linuxOsInfo")] - public LinuxOsInfo LinuxOsInfo { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linuxOsInfo")] + public LinuxOsInfo LinuxOSInfo {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskProperties.cs index 20cb65e6a8dc..d8e88f29be16 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskProperties.cs @@ -1,21 +1,14 @@ -// // 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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Request body for adding a new or existing data disk to a virtual - /// machine. + /// Request body for adding a new or existing data disk to a virtual machine. /// public partial class DataDiskProperties { @@ -30,18 +23,21 @@ public DataDiskProperties() /// /// Initializes a new instance of the DataDiskProperties class. /// - /// Specifies options to attach - /// a new disk to the virtual machine. - /// Specifies the existing lab disk id - /// to attach to virtual machine. - /// Caching option for a data disk (i.e. - /// None, ReadOnly, ReadWrite). Possible values include: 'None', - /// 'ReadOnly', 'ReadWrite' + + /// Specifies options to attach a new disk to the virtual machine. + /// + + /// Specifies the existing lab disk id to attach to virtual machine. + /// + + /// Caching option for a data disk (i.e. None, ReadOnly, ReadWrite). + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' public DataDiskProperties(AttachNewDataDiskOptions attachNewDataDiskOptions = default(AttachNewDataDiskOptions), string existingLabDiskId = default(string), string hostCaching = default(string)) + { - AttachNewDataDiskOptions = attachNewDataDiskOptions; - ExistingLabDiskId = existingLabDiskId; - HostCaching = hostCaching; + this.AttachNewDataDiskOptions = attachNewDataDiskOptions; + this.ExistingLabDiskId = existingLabDiskId; + this.HostCaching = hostCaching; CustomInit(); } @@ -50,27 +46,25 @@ public DataDiskProperties() /// partial void CustomInit(); + /// - /// Gets or sets specifies options to attach a new disk to the virtual - /// machine. + /// Gets or sets specifies options to attach a new disk to the virtual machine. /// - [JsonProperty(PropertyName = "attachNewDataDiskOptions")] - public AttachNewDataDiskOptions AttachNewDataDiskOptions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "attachNewDataDiskOptions")] + public AttachNewDataDiskOptions AttachNewDataDiskOptions {get; set; } /// - /// Gets or sets specifies the existing lab disk id to attach to - /// virtual machine. + /// Gets or sets specifies the existing lab disk id to attach to virtual + /// machine. /// - [JsonProperty(PropertyName = "existingLabDiskId")] - public string ExistingLabDiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "existingLabDiskId")] + public string ExistingLabDiskId {get; set; } /// /// Gets or sets caching option for a data disk (i.e. None, ReadOnly, - /// ReadWrite). Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' + /// ReadWrite). Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "hostCaching")] - public string HostCaching { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hostCaching")] + public string HostCaching {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetails.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetails.cs index 63c3ddbec6d9..ccde19a43693 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetails.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetails.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public DayDetails() /// /// Initializes a new instance of the DayDetails class. /// - /// The time of day the schedule will occur. + + /// The time of day the schedule will occur. + /// public DayDetails(string time = default(string)) + { - Time = time; + this.Time = time; CustomInit(); } @@ -41,11 +38,11 @@ public DayDetails() /// partial void CustomInit(); + /// /// Gets or sets the time of day the schedule will occur. /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "time")] + public string Time {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetailsFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetailsFragment.cs index 411c0d965773..626bf8068f50 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetailsFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetailsFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public DayDetailsFragment() /// /// Initializes a new instance of the DayDetailsFragment class. /// - /// The time of day the schedule will occur. + + /// The time of day the schedule will occur. + /// public DayDetailsFragment(string time = default(string)) + { - Time = time; + this.Time = time; CustomInit(); } @@ -41,11 +38,11 @@ public DayDetailsFragment() /// partial void CustomInit(); + /// /// Gets or sets the time of day the schedule will occur. /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "time")] + public string Time {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDataDiskProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDataDiskProperties.cs index 831adf71d768..6a88ef5a2046 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDataDiskProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDataDiskProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public DetachDataDiskProperties() /// /// Initializes a new instance of the DetachDataDiskProperties class. /// - /// Specifies the disk resource ID to - /// detach from virtual machine. + + /// Specifies the disk resource ID to detach from virtual machine. + /// public DetachDataDiskProperties(string existingLabDiskId = default(string)) + { - ExistingLabDiskId = existingLabDiskId; + this.ExistingLabDiskId = existingLabDiskId; CustomInit(); } @@ -42,12 +38,11 @@ public DetachDataDiskProperties() /// partial void CustomInit(); + /// - /// Gets or sets specifies the disk resource ID to detach from virtual - /// machine. + /// Gets or sets specifies the disk resource ID to detach from virtual machine. /// - [JsonProperty(PropertyName = "existingLabDiskId")] - public string ExistingLabDiskId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "existingLabDiskId")] + public string ExistingLabDiskId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDiskProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDiskProperties.cs index 1b7f32948b97..b7e962b8c5e5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDiskProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDiskProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public DetachDiskProperties() /// /// Initializes a new instance of the DetachDiskProperties class. /// - /// The resource ID of the Lab VM to - /// which the disk is attached. - public DetachDiskProperties(string leasedByLabVmId = default(string)) + + /// The resource ID of the Lab VM to which the disk is attached. + /// + public DetachDiskProperties(string leasedByLabVMId = default(string)) + { - LeasedByLabVmId = leasedByLabVmId; + this.LeasedByLabVMId = leasedByLabVMId; CustomInit(); } @@ -42,12 +38,11 @@ public DetachDiskProperties() /// partial void CustomInit(); + /// - /// Gets or sets the resource ID of the Lab VM to which the disk is - /// attached. + /// Gets or sets the resource ID of the Lab VM to which the disk is attached. /// - [JsonProperty(PropertyName = "leasedByLabVmId")] - public string LeasedByLabVmId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "leasedByLabVmId")] + public string LeasedByLabVMId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Disk.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Disk.cs index 6fdf24337a2e..f10edc0bcf0c 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Disk.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Disk.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A Disk. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Disk : Resource { /// @@ -34,44 +24,65 @@ public Disk() /// /// Initializes a new instance of the Disk class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The storage type for the disk (i.e. - /// Standard, Premium). Possible values include: 'Standard', - /// 'Premium' - /// The size of the disk in - /// GibiBytes. - /// The resource ID of the VM to which - /// this disk is leased. - /// When backed by a blob, the name of the - /// VHD blob without extension. - /// When backed by a blob, the URI of underlying - /// blob. - /// The creation date of the disk. - /// The host caching policy of the disk (i.e. - /// None, ReadOnly, ReadWrite). - /// When backed by managed disk, this is - /// the ID of the compute disk resource. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Disk(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string diskType = default(string), int? diskSizeGiB = default(int?), string leasedByLabVmId = default(string), string diskBlobName = default(string), string diskUri = default(string), System.DateTime? createdDate = default(System.DateTime?), string hostCaching = default(string), string managedDiskId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The storage type for the disk (i.e. Standard, Premium). + /// Possible values include: 'Standard', 'Premium' + + /// The size of the disk in GibiBytes. + /// + + /// The resource ID of the VM to which this disk is leased. + /// + + /// When backed by a blob, the name of the VHD blob without extension. + /// + + /// When backed by a blob, the URI of underlying blob. + /// + + /// The creation date of the disk. + /// + + /// The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + /// + + /// When backed by managed disk, this is the ID of the compute disk resource. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public Disk(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), string diskType = default(string), int? diskSizeGiB = default(int?), string leasedByLabVMId = default(string), string diskBlobName = default(string), string diskUri = default(string), System.DateTime? createdDate = default(System.DateTime?), string hostCaching = default(string), string managedDiskId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - DiskType = diskType; - DiskSizeGiB = diskSizeGiB; - LeasedByLabVmId = leasedByLabVmId; - DiskBlobName = diskBlobName; - DiskUri = diskUri; - CreatedDate = createdDate; - HostCaching = hostCaching; - ManagedDiskId = managedDiskId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.DiskType = diskType; + this.DiskSizeGiB = diskSizeGiB; + this.LeasedByLabVMId = leasedByLabVMId; + this.DiskBlobName = diskBlobName; + this.DiskUri = diskUri; + this.CreatedDate = createdDate; + this.HostCaching = hostCaching; + this.ManagedDiskId = managedDiskId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -80,70 +91,68 @@ public Disk() /// partial void CustomInit(); + /// - /// Gets or sets the storage type for the disk (i.e. Standard, - /// Premium). Possible values include: 'Standard', 'Premium' + /// Gets or sets the storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium' /// - [JsonProperty(PropertyName = "properties.diskType")] - public string DiskType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskType")] + public string DiskType {get; set; } /// /// Gets or sets the size of the disk in GibiBytes. /// - [JsonProperty(PropertyName = "properties.diskSizeGiB")] - public int? DiskSizeGiB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeGiB")] + public int? DiskSizeGiB {get; set; } /// - /// Gets or sets the resource ID of the VM to which this disk is - /// leased. + /// Gets or sets the resource ID of the VM to which this disk is leased. /// - [JsonProperty(PropertyName = "properties.leasedByLabVmId")] - public string LeasedByLabVmId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.leasedByLabVmId")] + public string LeasedByLabVMId {get; set; } /// - /// Gets or sets when backed by a blob, the name of the VHD blob - /// without extension. + /// Gets or sets when backed by a blob, the name of the VHD blob without + /// extension. /// - [JsonProperty(PropertyName = "properties.diskBlobName")] - public string DiskBlobName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskBlobName")] + public string DiskBlobName {get; set; } /// /// Gets or sets when backed by a blob, the URI of underlying blob. /// - [JsonProperty(PropertyName = "properties.diskUri")] - public string DiskUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskUri")] + public string DiskUri {get; set; } /// /// Gets the creation date of the disk. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// - /// Gets or sets the host caching policy of the disk (i.e. None, - /// ReadOnly, ReadWrite). + /// Gets or sets the host caching policy of the disk (i.e. None, ReadOnly, + /// ReadWrite). /// - [JsonProperty(PropertyName = "properties.hostCaching")] - public string HostCaching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostCaching")] + public string HostCaching {get; set; } /// - /// Gets or sets when backed by managed disk, this is the ID of the - /// compute disk resource. + /// Gets or sets when backed by managed disk, this is the ID of the compute + /// disk resource. /// - [JsonProperty(PropertyName = "properties.managedDiskId")] - public string ManagedDiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.managedDiskId")] + public string ManagedDiskId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DiskProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DiskProperties.cs new file mode 100644 index 000000000000..2b2a5af4dd25 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DiskProperties.cs @@ -0,0 +1,141 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a disk. + /// + public partial class DiskProperties + { + /// + /// Initializes a new instance of the DiskProperties class. + /// + public DiskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskProperties class. + /// + + /// The storage type for the disk (i.e. Standard, Premium). + /// Possible values include: 'Standard', 'Premium' + + /// The size of the disk in GibiBytes. + /// + + /// The resource ID of the VM to which this disk is leased. + /// + + /// When backed by a blob, the name of the VHD blob without extension. + /// + + /// When backed by a blob, the URI of underlying blob. + /// + + /// The creation date of the disk. + /// + + /// The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + /// + + /// When backed by managed disk, this is the ID of the compute disk resource. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public DiskProperties(string diskType = default(string), int? diskSizeGiB = default(int?), string leasedByLabVMId = default(string), string diskBlobName = default(string), string diskUri = default(string), System.DateTime? createdDate = default(System.DateTime?), string hostCaching = default(string), string managedDiskId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.DiskType = diskType; + this.DiskSizeGiB = diskSizeGiB; + this.LeasedByLabVMId = leasedByLabVMId; + this.DiskBlobName = diskBlobName; + this.DiskUri = diskUri; + this.CreatedDate = createdDate; + this.HostCaching = hostCaching; + this.ManagedDiskId = managedDiskId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskType")] + public string DiskType {get; set; } + + /// + /// Gets or sets the size of the disk in GibiBytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGiB")] + public int? DiskSizeGiB {get; set; } + + /// + /// Gets or sets the resource ID of the VM to which this disk is leased. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "leasedByLabVmId")] + public string LeasedByLabVMId {get; set; } + + /// + /// Gets or sets when backed by a blob, the name of the VHD blob without + /// extension. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskBlobName")] + public string DiskBlobName {get; set; } + + /// + /// Gets or sets when backed by a blob, the URI of underlying blob. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskUri")] + public string DiskUri {get; set; } + + /// + /// Gets the creation date of the disk. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the host caching policy of the disk (i.e. None, ReadOnly, + /// ReadWrite). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostCaching")] + public string HostCaching {get; set; } + + /// + /// Gets or sets when backed by managed disk, this is the ID of the compute + /// disk resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDiskId")] + public string ManagedDiskId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DtlEnvironment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DtlEnvironment.cs index 5522f701441e..cf3276c72607 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DtlEnvironment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DtlEnvironment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// An environment, which is essentially an ARM template deployment. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DtlEnvironment : Resource { /// @@ -34,31 +24,51 @@ public DtlEnvironment() /// /// Initializes a new instance of the DtlEnvironment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The deployment properties of the - /// environment. - /// The display name of the Azure - /// Resource Manager template that produced the environment. - /// The identifier of the resource group - /// containing the environment's resources. - /// The creator of the environment. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public DtlEnvironment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), EnvironmentDeploymentProperties deploymentProperties = default(EnvironmentDeploymentProperties), string armTemplateDisplayName = default(string), string resourceGroupId = default(string), string createdByUser = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The deployment properties of the environment. + /// + + /// The display name of the Azure Resource Manager template that produced the + /// environment. + /// + + /// The identifier of the resource group containing the environment's + /// resources. + /// + + /// The creator of the environment. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public DtlEnvironment(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), EnvironmentDeploymentProperties deploymentProperties = default(EnvironmentDeploymentProperties), string armTemplateDisplayName = default(string), string resourceGroupId = default(string), string createdByUser = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - DeploymentProperties = deploymentProperties; - ArmTemplateDisplayName = armTemplateDisplayName; - ResourceGroupId = resourceGroupId; - CreatedByUser = createdByUser; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.DeploymentProperties = deploymentProperties; + this.ArmTemplateDisplayName = armTemplateDisplayName; + this.ResourceGroupId = resourceGroupId; + this.CreatedByUser = createdByUser; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -67,43 +77,43 @@ public DtlEnvironment() /// partial void CustomInit(); + /// /// Gets or sets the deployment properties of the environment. /// - [JsonProperty(PropertyName = "properties.deploymentProperties")] - public EnvironmentDeploymentProperties DeploymentProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deploymentProperties")] + public EnvironmentDeploymentProperties DeploymentProperties {get; set; } /// - /// Gets or sets the display name of the Azure Resource Manager - /// template that produced the environment. + /// Gets or sets the display name of the Azure Resource Manager template that + /// produced the environment. /// - [JsonProperty(PropertyName = "properties.armTemplateDisplayName")] - public string ArmTemplateDisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.armTemplateDisplayName")] + public string ArmTemplateDisplayName {get; set; } /// - /// Gets the identifier of the resource group containing the - /// environment's resources. + /// Gets the identifier of the resource group containing the environment's + /// resources. /// - [JsonProperty(PropertyName = "properties.resourceGroupId")] - public string ResourceGroupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGroupId")] + public string ResourceGroupId {get; private set; } /// /// Gets the creator of the environment. /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUser")] + public string CreatedByUser {get; private set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnableStatus.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnableStatus.cs index 275695266d64..2cae1466a544 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnableStatus.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnableStatus.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for EnableStatus. /// + + public static class EnableStatus { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentDeploymentProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentDeploymentProperties.cs index 7f232051558b..682751389878 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentDeploymentProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentDeploymentProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class EnvironmentDeploymentProperties { /// - /// Initializes a new instance of the EnvironmentDeploymentProperties - /// class. + /// Initializes a new instance of the EnvironmentDeploymentProperties class. /// public EnvironmentDeploymentProperties() { @@ -30,17 +21,19 @@ public EnvironmentDeploymentProperties() } /// - /// Initializes a new instance of the EnvironmentDeploymentProperties - /// class. + /// Initializes a new instance of the EnvironmentDeploymentProperties class. /// - /// The Azure Resource Manager template's - /// identifier. - /// The parameters of the Azure Resource - /// Manager template. - public EnvironmentDeploymentProperties(string armTemplateId = default(string), IList parameters = default(IList)) + + /// The Azure Resource Manager template's identifier. + /// + + /// The parameters of the Azure Resource Manager template. + /// + public EnvironmentDeploymentProperties(string armTemplateId = default(string), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList)) + { - ArmTemplateId = armTemplateId; - Parameters = parameters; + this.ArmTemplateId = armTemplateId; + this.Parameters = parameters; CustomInit(); } @@ -49,17 +42,17 @@ public EnvironmentDeploymentProperties() /// partial void CustomInit(); + /// - /// Gets or sets the Azure Resource Manager template's identifier. + /// Gets or sets the Azure Resource Manager template's identifier. /// - [JsonProperty(PropertyName = "armTemplateId")] - public string ArmTemplateId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "armTemplateId")] + public string ArmTemplateId {get; set; } /// /// Gets or sets the parameters of the Azure Resource Manager template. /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentProperties.cs new file mode 100644 index 000000000000..d5e0093b9fb3 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentProperties.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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of an environment. + /// + public partial class EnvironmentProperties + { + /// + /// Initializes a new instance of the EnvironmentProperties class. + /// + public EnvironmentProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EnvironmentProperties class. + /// + + /// The deployment properties of the environment. + /// + + /// The display name of the Azure Resource Manager template that produced the + /// environment. + /// + + /// The identifier of the resource group containing the environment's + /// resources. + /// + + /// The creator of the environment. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public EnvironmentProperties(EnvironmentDeploymentProperties deploymentProperties = default(EnvironmentDeploymentProperties), string armTemplateDisplayName = default(string), string resourceGroupId = default(string), string createdByUser = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.DeploymentProperties = deploymentProperties; + this.ArmTemplateDisplayName = armTemplateDisplayName; + this.ResourceGroupId = resourceGroupId; + this.CreatedByUser = createdByUser; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the deployment properties of the environment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentProperties")] + public EnvironmentDeploymentProperties DeploymentProperties {get; set; } + + /// + /// Gets or sets the display name of the Azure Resource Manager template that + /// produced the environment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "armTemplateDisplayName")] + public string ArmTemplateDisplayName {get; set; } + + /// + /// Gets the identifier of the resource group containing the environment's + /// resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupId")] + public string ResourceGroupId {get; private set; } + + /// + /// Gets the creator of the environment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUser")] + public string CreatedByUser {get; private set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesProperties.cs index 5a099faed54a..3bc52cfa91a8 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public EvaluatePoliciesProperties() /// /// Initializes a new instance of the EvaluatePoliciesProperties class. /// - /// The fact name. - /// The fact data. - /// The value offset. + + /// The fact name. + /// + + /// The fact data. + /// + + /// The value offset. + /// public EvaluatePoliciesProperties(string factName = default(string), string factData = default(string), string valueOffset = default(string)) + { - FactName = factName; - FactData = factData; - ValueOffset = valueOffset; + this.FactName = factName; + this.FactData = factData; + this.ValueOffset = valueOffset; CustomInit(); } @@ -45,23 +46,23 @@ public EvaluatePoliciesProperties() /// partial void CustomInit(); + /// /// Gets or sets the fact name. /// - [JsonProperty(PropertyName = "factName")] - public string FactName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "factName")] + public string FactName {get; set; } /// /// Gets or sets the fact data. /// - [JsonProperty(PropertyName = "factData")] - public string FactData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "factData")] + public string FactData {get; set; } /// /// Gets or sets the value offset. /// - [JsonProperty(PropertyName = "valueOffset")] - public string ValueOffset { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "valueOffset")] + public string ValueOffset {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesRequest.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesRequest.cs index b475886904f8..8ea313544d2a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesRequest.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesRequest.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public EvaluatePoliciesRequest() /// /// Initializes a new instance of the EvaluatePoliciesRequest class. /// - /// Policies to evaluate. - public EvaluatePoliciesRequest(IList policies = default(IList)) + + /// Policies to evaluate. + /// + public EvaluatePoliciesRequest(System.Collections.Generic.IList policies = default(System.Collections.Generic.IList)) + { - Policies = policies; + this.Policies = policies; CustomInit(); } @@ -43,11 +38,11 @@ public EvaluatePoliciesRequest() /// partial void CustomInit(); + /// /// Gets or sets policies to evaluate. /// - [JsonProperty(PropertyName = "policies")] - public IList Policies { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "policies")] + public System.Collections.Generic.IList Policies {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesResponse.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesResponse.cs index 2863860ca890..0dbd65f4391f 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesResponse.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesResponse.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public EvaluatePoliciesResponse() /// /// Initializes a new instance of the EvaluatePoliciesResponse class. /// - /// Results of evaluating a policy set. - public EvaluatePoliciesResponse(IList results = default(IList)) + + /// Results of evaluating a policy set. + /// + public EvaluatePoliciesResponse(System.Collections.Generic.IList results = default(System.Collections.Generic.IList)) + { - Results = results; + this.Results = results; CustomInit(); } @@ -43,11 +38,11 @@ public EvaluatePoliciesResponse() /// partial void CustomInit(); + /// /// Gets or sets results of evaluating a policy set. /// - [JsonProperty(PropertyName = "results")] - public IList Results { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "results")] + public System.Collections.Generic.IList Results {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventFragment.cs index 70a246af5764..16ceb43dac3e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,14 @@ public EventFragment() /// /// Initializes a new instance of the EventFragment class. /// - /// The event type for which this notification - /// is enabled (i.e. AutoShutdown, Cost). Possible values include: - /// 'AutoShutdown', 'Cost' + + /// The event type for which this notification is enabled (i.e. AutoShutdown, + /// Cost) + /// Possible values include: 'AutoShutdown', 'Cost' public EventFragment(string eventName = default(string)) + { - EventName = eventName; + this.EventName = eventName; CustomInit(); } @@ -43,13 +39,12 @@ public EventFragment() /// partial void CustomInit(); + /// - /// Gets or sets the event type for which this notification is enabled - /// (i.e. AutoShutdown, Cost). Possible values include: 'AutoShutdown', - /// 'Cost' + /// Gets or sets the event type for which this notification is enabled (i.e. + /// AutoShutdown, Cost) Possible values include: 'AutoShutdown', 'Cost' /// - [JsonProperty(PropertyName = "eventName")] - public string EventName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + public string EventName {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventModel.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventModel.cs index acbff2cccecf..8d0b18eceb8a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventModel.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventModel.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,14 @@ public EventModel() /// /// Initializes a new instance of the EventModel class. /// - /// The event type for which this notification - /// is enabled (i.e. AutoShutdown, Cost). Possible values include: - /// 'AutoShutdown', 'Cost' + + /// The event type for which this notification is enabled (i.e. AutoShutdown, + /// Cost) + /// Possible values include: 'AutoShutdown', 'Cost' public EventModel(string eventName = default(string)) + { - EventName = eventName; + this.EventName = eventName; CustomInit(); } @@ -43,13 +39,12 @@ public EventModel() /// partial void CustomInit(); + /// - /// Gets or sets the event type for which this notification is enabled - /// (i.e. AutoShutdown, Cost). Possible values include: 'AutoShutdown', - /// 'Cost' + /// Gets or sets the event type for which this notification is enabled (i.e. + /// AutoShutdown, Cost) Possible values include: 'AutoShutdown', 'Cost' /// - [JsonProperty(PropertyName = "eventName")] - public string EventName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + public string EventName {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExportResourceUsageParameters.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExportResourceUsageParameters.cs index 64c01216e84c..4a435cfb7648 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExportResourceUsageParameters.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExportResourceUsageParameters.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ExportResourceUsageParameters { /// - /// Initializes a new instance of the ExportResourceUsageParameters - /// class. + /// Initializes a new instance of the ExportResourceUsageParameters class. /// public ExportResourceUsageParameters() { @@ -28,19 +21,21 @@ public ExportResourceUsageParameters() } /// - /// Initializes a new instance of the ExportResourceUsageParameters - /// class. + /// Initializes a new instance of the ExportResourceUsageParameters class. /// - /// The blob storage absolute - /// sas uri with write permission to the container which the usage data - /// needs to be uploaded to. - /// The start time of the usage. If not - /// provided, usage will be reported since the beginning of data - /// collection. + + /// The blob storage absolute sas uri with write permission to the container + /// which the usage data needs to be uploaded to. + /// + + /// The start time of the usage. If not provided, usage will be reported since + /// the beginning of data collection. + /// public ExportResourceUsageParameters(string blobStorageAbsoluteSasUri = default(string), System.DateTime? usageStartDate = default(System.DateTime?)) + { - BlobStorageAbsoluteSasUri = blobStorageAbsoluteSasUri; - UsageStartDate = usageStartDate; + this.BlobStorageAbsoluteSasUri = blobStorageAbsoluteSasUri; + this.UsageStartDate = usageStartDate; CustomInit(); } @@ -49,20 +44,19 @@ public ExportResourceUsageParameters() /// partial void CustomInit(); + /// - /// Gets or sets the blob storage absolute sas uri with write - /// permission to the container which the usage data needs to be - /// uploaded to. + /// Gets or sets the blob storage absolute sas uri with write permission to the + /// container which the usage data needs to be uploaded to. /// - [JsonProperty(PropertyName = "blobStorageAbsoluteSasUri")] - public string BlobStorageAbsoluteSasUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "blobStorageAbsoluteSasUri")] + public string BlobStorageAbsoluteSasUri {get; set; } /// - /// Gets or sets the start time of the usage. If not provided, usage - /// will be reported since the beginning of data collection. + /// Gets or sets the start time of the usage. If not provided, usage will be + /// reported since the beginning of data collection. /// - [JsonProperty(PropertyName = "usageStartDate")] - public System.DateTime? UsageStartDate { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "usageStartDate")] + public System.DateTime? UsageStartDate {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnet.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnet.cs index 1b5d3ba8b0b4..63b833351697 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnet.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnet.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ExternalSubnet() /// /// Initializes a new instance of the ExternalSubnet class. /// - /// Gets or sets the identifier. - /// Gets or sets the name. + + /// Gets or sets the identifier. + /// + + /// Gets or sets the name. + /// public ExternalSubnet(string id = default(string), string name = default(string)) + { - Id = id; - Name = name; + this.Id = id; + this.Name = name; CustomInit(); } @@ -43,17 +42,17 @@ public ExternalSubnet() /// partial void CustomInit(); + /// - /// Gets or sets the identifier. + /// Gets or sets gets or sets the identifier. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the name. + /// Gets or sets gets or sets the name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnetFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnetFragment.cs index 63b781689d81..f82e7398706b 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnetFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnetFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ExternalSubnetFragment() /// /// Initializes a new instance of the ExternalSubnetFragment class. /// - /// Gets or sets the identifier. - /// Gets or sets the name. + + /// Gets or sets the identifier. + /// + + /// Gets or sets the name. + /// public ExternalSubnetFragment(string id = default(string), string name = default(string)) + { - Id = id; - Name = name; + this.Id = id; + this.Name = name; CustomInit(); } @@ -43,17 +42,17 @@ public ExternalSubnetFragment() /// partial void CustomInit(); + /// - /// Gets or sets the identifier. + /// Gets or sets gets or sets the identifier. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the name. + /// Gets or sets gets or sets the name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FileUploadOptions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FileUploadOptions.cs index c941785310e8..eeb580ffb8c8 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FileUploadOptions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FileUploadOptions.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for FileUploadOptions. /// + + public static class FileUploadOptions { public const string UploadFilesAndGenerateSasTokens = "UploadFilesAndGenerateSasTokens"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Formula.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Formula.cs index 6551596f5142..a5a22ca401ef 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Formula.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Formula.cs @@ -1,27 +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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// A formula for creating a VM, specifying an image base and other - /// parameters + /// A formula for creating a VM, specifying an image base and other parameters /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Formula : Resource { /// @@ -35,34 +24,57 @@ public Formula() /// /// Initializes a new instance of the Formula class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The description of the formula. - /// The author of the formula. - /// The OS type of the formula. - /// The creation date of the - /// formula. - /// The content of the formula. - /// Information about a VM from which a formula is to - /// be created. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Formula(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string author = default(string), string osType = default(string), System.DateTime? creationDate = default(System.DateTime?), LabVirtualMachineCreationParameter formulaContent = default(LabVirtualMachineCreationParameter), FormulaPropertiesFromVm vm = default(FormulaPropertiesFromVm), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The description of the formula. + /// + + /// The author of the formula. + /// + + /// The OS type of the formula. + /// + + /// The creation date of the formula. + /// + + /// The content of the formula. + /// + + /// Information about a VM from which a formula is to be created. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public Formula(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), string description = default(string), string author = default(string), string osType = default(string), System.DateTime? creationDate = default(System.DateTime?), LabVirtualMachineCreationParameter formulaContent = default(LabVirtualMachineCreationParameter), FormulaPropertiesFromVm vm = default(FormulaPropertiesFromVm), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Description = description; - Author = author; - OsType = osType; - CreationDate = creationDate; - FormulaContent = formulaContent; - Vm = vm; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Description = description; + this.Author = author; + this.OSType = osType; + this.CreationDate = creationDate; + this.FormulaContent = formulaContent; + this.VM = vm; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -71,54 +83,53 @@ public Formula() /// partial void CustomInit(); + /// /// Gets or sets the description of the formula. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// /// Gets or sets the author of the formula. /// - [JsonProperty(PropertyName = "properties.author")] - public string Author { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.author")] + public string Author {get; set; } /// /// Gets or sets the OS type of the formula. /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public string OSType {get; set; } /// /// Gets the creation date of the formula. /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate {get; private set; } /// /// Gets or sets the content of the formula. /// - [JsonProperty(PropertyName = "properties.formulaContent")] - public LabVirtualMachineCreationParameter FormulaContent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.formulaContent")] + public LabVirtualMachineCreationParameter FormulaContent {get; set; } /// - /// Gets or sets information about a VM from which a formula is to be - /// created. + /// Gets or sets information about a VM from which a formula is to be created. /// - [JsonProperty(PropertyName = "properties.vm")] - public FormulaPropertiesFromVm Vm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vm")] + public FormulaPropertiesFromVm VM {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaProperties.cs new file mode 100644 index 000000000000..9ba7caf9ec10 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaProperties.cs @@ -0,0 +1,118 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a formula. + /// + public partial class FormulaProperties + { + /// + /// Initializes a new instance of the FormulaProperties class. + /// + public FormulaProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FormulaProperties class. + /// + + /// The description of the formula. + /// + + /// The author of the formula. + /// + + /// The OS type of the formula. + /// + + /// The creation date of the formula. + /// + + /// The content of the formula. + /// + + /// Information about a VM from which a formula is to be created. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public FormulaProperties(string description = default(string), string author = default(string), string osType = default(string), System.DateTime? creationDate = default(System.DateTime?), LabVirtualMachineCreationParameter formulaContent = default(LabVirtualMachineCreationParameter), FormulaPropertiesFromVm vm = default(FormulaPropertiesFromVm), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Description = description; + this.Author = author; + this.OSType = osType; + this.CreationDate = creationDate; + this.FormulaContent = formulaContent; + this.VM = vm; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the description of the formula. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the author of the formula. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "author")] + public string Author {get; set; } + + /// + /// Gets or sets the OS type of the formula. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } + + /// + /// Gets the creation date of the formula. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + public System.DateTime? CreationDate {get; private set; } + + /// + /// Gets or sets the content of the formula. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "formulaContent")] + public LabVirtualMachineCreationParameter FormulaContent {get; set; } + + /// + /// Gets or sets information about a VM from which a formula is to be created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vm")] + public FormulaPropertiesFromVm VM {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaPropertiesFromVm.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaPropertiesFromVm.cs index 8a8484790d4b..5da4ee97675f 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaPropertiesFromVm.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaPropertiesFromVm.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public FormulaPropertiesFromVm() /// /// Initializes a new instance of the FormulaPropertiesFromVm class. /// - /// The identifier of the VM from which a formula - /// is to be created. - public FormulaPropertiesFromVm(string labVmId = default(string)) + + /// The identifier of the VM from which a formula is to be created. + /// + public FormulaPropertiesFromVm(string labVMId = default(string)) + { - LabVmId = labVmId; + this.LabVMId = labVMId; CustomInit(); } @@ -42,12 +38,12 @@ public FormulaPropertiesFromVm() /// partial void CustomInit(); + /// /// Gets or sets the identifier of the VM from which a formula is to be /// created. /// - [JsonProperty(PropertyName = "labVmId")] - public string LabVmId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "labVmId")] + public string LabVMId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImage.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImage.cs index 6471ae4f7d3b..6c968a486825 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImage.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImage.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A gallery image. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryImage : Resource { /// @@ -34,30 +24,49 @@ public GalleryImage() /// /// Initializes a new instance of the GalleryImage class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The author of the gallery image. - /// The creation date of the gallery - /// image. - /// The description of the gallery - /// image. - /// The image reference of the gallery - /// image. - /// The icon of the gallery image. - /// Indicates whether this gallery image is - /// enabled. - public GalleryImage(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string author = default(string), System.DateTime? createdDate = default(System.DateTime?), string description = default(string), GalleryImageReference imageReference = default(GalleryImageReference), string icon = default(string), bool? enabled = default(bool?)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The author of the gallery image. + /// + + /// The creation date of the gallery image. + /// + + /// The description of the gallery image. + /// + + /// The image reference of the gallery image. + /// + + /// The icon of the gallery image. + /// + + /// Indicates whether this gallery image is enabled. + /// + public GalleryImage(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), string author = default(string), System.DateTime? createdDate = default(System.DateTime?), string description = default(string), GalleryImageReference imageReference = default(GalleryImageReference), string icon = default(string), bool? enabled = default(bool?)) + + : base(id, name, type, location, tags) { - Author = author; - CreatedDate = createdDate; - Description = description; - ImageReference = imageReference; - Icon = icon; - Enabled = enabled; + this.Author = author; + this.CreatedDate = createdDate; + this.Description = description; + this.ImageReference = imageReference; + this.Icon = icon; + this.Enabled = enabled; CustomInit(); } @@ -66,41 +75,41 @@ public GalleryImage() /// partial void CustomInit(); + /// /// Gets or sets the author of the gallery image. /// - [JsonProperty(PropertyName = "properties.author")] - public string Author { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.author")] + public string Author {get; set; } /// /// Gets the creation date of the gallery image. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the description of the gallery image. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// /// Gets or sets the image reference of the gallery image. /// - [JsonProperty(PropertyName = "properties.imageReference")] - public GalleryImageReference ImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.imageReference")] + public GalleryImageReference ImageReference {get; set; } /// /// Gets or sets the icon of the gallery image. /// - [JsonProperty(PropertyName = "properties.icon")] - public string Icon { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.icon")] + public string Icon {get; set; } /// /// Gets or sets indicates whether this gallery image is enabled. /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageProperties.cs new file mode 100644 index 000000000000..f1d163cf1fba --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageProperties.cs @@ -0,0 +1,98 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a gallery image. + /// + public partial class GalleryImageProperties + { + /// + /// Initializes a new instance of the GalleryImageProperties class. + /// + public GalleryImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryImageProperties class. + /// + + /// The author of the gallery image. + /// + + /// The creation date of the gallery image. + /// + + /// The description of the gallery image. + /// + + /// The image reference of the gallery image. + /// + + /// The icon of the gallery image. + /// + + /// Indicates whether this gallery image is enabled. + /// + public GalleryImageProperties(string author = default(string), System.DateTime? createdDate = default(System.DateTime?), string description = default(string), GalleryImageReference imageReference = default(GalleryImageReference), string icon = default(string), bool? enabled = default(bool?)) + + { + this.Author = author; + this.CreatedDate = createdDate; + this.Description = description; + this.ImageReference = imageReference; + this.Icon = icon; + this.Enabled = enabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the author of the gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "author")] + public string Author {get; set; } + + /// + /// Gets the creation date of the gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the description of the gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the image reference of the gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "imageReference")] + public GalleryImageReference ImageReference {get; set; } + + /// + /// Gets or sets the icon of the gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "icon")] + public string Icon {get; set; } + + /// + /// Gets or sets indicates whether this gallery image is enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReference.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReference.cs index 47b51d16b606..14164edf7fb1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReference.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReference.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,29 @@ public GalleryImageReference() /// /// Initializes a new instance of the GalleryImageReference class. /// - /// The offer of the gallery image. - /// The publisher of the gallery image. - /// The SKU of the gallery image. - /// The OS type of the gallery image. - /// The version of the gallery image. + + /// The offer of the gallery image. + /// + + /// The publisher of the gallery image. + /// + + /// The SKU of the gallery image. + /// + + /// The OS type of the gallery image. + /// + + /// The version of the gallery image. + /// public GalleryImageReference(string offer = default(string), string publisher = default(string), string sku = default(string), string osType = default(string), string version = default(string)) + { - Offer = offer; - Publisher = publisher; - Sku = sku; - OsType = osType; - Version = version; + this.Offer = offer; + this.Publisher = publisher; + this.Sku = sku; + this.OSType = osType; + this.Version = version; CustomInit(); } @@ -49,35 +54,35 @@ public GalleryImageReference() /// partial void CustomInit(); + /// /// Gets or sets the offer of the gallery image. /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offer")] + public string Offer {get; set; } /// /// Gets or sets the publisher of the gallery image. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets the SKU of the gallery image. /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } /// /// Gets or sets the OS type of the gallery image. /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } /// /// Gets or sets the version of the gallery image. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReferenceFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReferenceFragment.cs index 690ad674a0bd..08c01b2b9df5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReferenceFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReferenceFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class GalleryImageReferenceFragment { /// - /// Initializes a new instance of the GalleryImageReferenceFragment - /// class. + /// Initializes a new instance of the GalleryImageReferenceFragment class. /// public GalleryImageReferenceFragment() { @@ -28,21 +21,31 @@ public GalleryImageReferenceFragment() } /// - /// Initializes a new instance of the GalleryImageReferenceFragment - /// class. + /// Initializes a new instance of the GalleryImageReferenceFragment class. /// - /// The offer of the gallery image. - /// The publisher of the gallery image. - /// The SKU of the gallery image. - /// The OS type of the gallery image. - /// The version of the gallery image. + + /// The offer of the gallery image. + /// + + /// The publisher of the gallery image. + /// + + /// The SKU of the gallery image. + /// + + /// The OS type of the gallery image. + /// + + /// The version of the gallery image. + /// public GalleryImageReferenceFragment(string offer = default(string), string publisher = default(string), string sku = default(string), string osType = default(string), string version = default(string)) + { - Offer = offer; - Publisher = publisher; - Sku = sku; - OsType = osType; - Version = version; + this.Offer = offer; + this.Publisher = publisher; + this.Sku = sku; + this.OSType = osType; + this.Version = version; CustomInit(); } @@ -51,35 +54,35 @@ public GalleryImageReferenceFragment() /// partial void CustomInit(); + /// /// Gets or sets the offer of the gallery image. /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offer")] + public string Offer {get; set; } /// /// Gets or sets the publisher of the gallery image. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets the SKU of the gallery image. /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } /// /// Gets or sets the OS type of the gallery image. /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } /// /// Gets or sets the version of the gallery image. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateArmTemplateRequest.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateArmTemplateRequest.cs index 0bea30d10a71..ce8eb6882bd9 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateArmTemplateRequest.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateArmTemplateRequest.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,21 +23,26 @@ public GenerateArmTemplateRequest() /// /// Initializes a new instance of the GenerateArmTemplateRequest class. /// - /// The resource name of the virtual - /// machine. - /// The parameters of the ARM - /// template. - /// The location of the virtual machine. - /// Options for uploading the files for - /// the artifact. UploadFilesAndGenerateSasTokens is the default value. - /// Possible values include: 'UploadFilesAndGenerateSasTokens', - /// 'None' - public GenerateArmTemplateRequest(string virtualMachineName = default(string), IList parameters = default(IList), string location = default(string), string fileUploadOptions = default(string)) + + /// The resource name of the virtual machine. + /// + + /// The parameters of the ARM template. + /// + + /// The location of the virtual machine. + /// + + /// Options for uploading the files for the artifact. + /// UploadFilesAndGenerateSasTokens is the default value. + /// Possible values include: 'UploadFilesAndGenerateSasTokens', 'None' + public GenerateArmTemplateRequest(string virtualMachineName = default(string), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList), string location = default(string), string fileUploadOptions = default(string)) + { - VirtualMachineName = virtualMachineName; - Parameters = parameters; - Location = location; - FileUploadOptions = fileUploadOptions; + this.VirtualMachineName = virtualMachineName; + this.Parameters = parameters; + this.Location = location; + this.FileUploadOptions = fileUploadOptions; CustomInit(); } @@ -54,31 +51,30 @@ public GenerateArmTemplateRequest() /// partial void CustomInit(); + /// /// Gets or sets the resource name of the virtual machine. /// - [JsonProperty(PropertyName = "virtualMachineName")] - public string VirtualMachineName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineName")] + public string VirtualMachineName {get; set; } /// /// Gets or sets the parameters of the ARM template. /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Gets or sets the location of the virtual machine. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets options for uploading the files for the artifact. - /// UploadFilesAndGenerateSasTokens is the default value. Possible - /// values include: 'UploadFilesAndGenerateSasTokens', 'None' + /// UploadFilesAndGenerateSasTokens is the default value. Possible values include: 'UploadFilesAndGenerateSasTokens', 'None' /// - [JsonProperty(PropertyName = "fileUploadOptions")] - public string FileUploadOptions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "fileUploadOptions")] + public string FileUploadOptions {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriParameter.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriParameter.cs index d3aed3c1cd5a..fb83c2a22a5a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriParameter.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriParameter.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public GenerateUploadUriParameter() /// /// Initializes a new instance of the GenerateUploadUriParameter class. /// - /// The blob name of the upload URI. + + /// The blob name of the upload URI. + /// public GenerateUploadUriParameter(string blobName = default(string)) + { - BlobName = blobName; + this.BlobName = blobName; CustomInit(); } @@ -41,11 +38,11 @@ public GenerateUploadUriParameter() /// partial void CustomInit(); + /// /// Gets or sets the blob name of the upload URI. /// - [JsonProperty(PropertyName = "blobName")] - public string BlobName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "blobName")] + public string BlobName {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriResponse.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriResponse.cs index 89138998bb1f..5109bd4e1886 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriResponse.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriResponse.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public GenerateUploadUriResponse() /// /// Initializes a new instance of the GenerateUploadUriResponse class. /// - /// The upload URI for the VHD. + + /// The upload URI for the VHD. + /// public GenerateUploadUriResponse(string uploadUri = default(string)) + { - UploadUri = uploadUri; + this.UploadUri = uploadUri; CustomInit(); } @@ -41,11 +38,11 @@ public GenerateUploadUriResponse() /// partial void CustomInit(); + /// /// Gets or sets the upload URI for the VHD. /// - [JsonProperty(PropertyName = "uploadUri")] - public string UploadUri { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "uploadUri")] + public string UploadUri {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HostCachingOptions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HostCachingOptions.cs index 912a3ae969bb..5056bcc0e92c 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HostCachingOptions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HostCachingOptions.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.DevTestLabs.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for HostCachingOptions. /// + + public static class HostCachingOptions { public const string None = "None"; public const string ReadOnly = "ReadOnly"; public const string ReadWrite = "ReadWrite"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetails.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetails.cs index 46baab3647c3..91ade0103cc1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetails.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetails.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public HourDetails() /// /// Initializes a new instance of the HourDetails class. /// - /// Minutes of the hour the schedule will - /// run. + + /// Minutes of the hour the schedule will run. + /// public HourDetails(int? minute = default(int?)) + { - Minute = minute; + this.Minute = minute; CustomInit(); } @@ -42,11 +38,11 @@ public HourDetails() /// partial void CustomInit(); + /// /// Gets or sets minutes of the hour the schedule will run. /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "minute")] + public int? Minute {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetailsFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetailsFragment.cs index 9abc4c1f633f..3e684d8b0bc1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetailsFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetailsFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public HourDetailsFragment() /// /// Initializes a new instance of the HourDetailsFragment class. /// - /// Minutes of the hour the schedule will - /// run. + + /// Minutes of the hour the schedule will run. + /// public HourDetailsFragment(int? minute = default(int?)) + { - Minute = minute; + this.Minute = minute; CustomInit(); } @@ -42,11 +38,11 @@ public HourDetailsFragment() /// partial void CustomInit(); + /// /// Gets or sets minutes of the hour the schedule will run. /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "minute")] + public int? Minute {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HttpStatusCode.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HttpStatusCode.cs index ae65a3ee7c89..1e678a311415 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HttpStatusCode.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HttpStatusCode.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.DevTestLabs.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for HttpStatusCode. /// + + public static class HttpStatusCode { public const string Continue = "Continue"; @@ -59,4 +56,4 @@ public static class HttpStatusCode public const string GatewayTimeout = "GatewayTimeout"; public const string HttpVersionNotSupported = "HttpVersionNotSupported"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/IdentityProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/IdentityProperties.cs index 852db48b0e93..0c58fae2b8ce 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/IdentityProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/IdentityProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public IdentityProperties() /// /// Initializes a new instance of the IdentityProperties class. /// - /// Managed identity. - /// The principal id of resource - /// identity. - /// The tenant identifier of resource. - /// The client secret URL of the - /// identity. + + /// Managed identity. + /// + + /// The principal id of resource identity. + /// + + /// The tenant identifier of resource. + /// + + /// The client secret URL of the identity. + /// public IdentityProperties(string type = default(string), string principalId = default(string), string tenantId = default(string), string clientSecretUrl = default(string)) + { - Type = type; - PrincipalId = principalId; - TenantId = tenantId; - ClientSecretUrl = clientSecretUrl; + this.Type = type; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.ClientSecretUrl = clientSecretUrl; CustomInit(); } @@ -49,29 +50,29 @@ public IdentityProperties() /// partial void CustomInit(); + /// /// Gets or sets managed identity. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the principal id of resource identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; set; } /// /// Gets or sets the tenant identifier of resource. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; set; } /// /// Gets or sets the client secret URL of the identity. /// - [JsonProperty(PropertyName = "clientSecretUrl")] - public string ClientSecretUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientSecretUrl")] + public string ClientSecretUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRule.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRule.cs index 8c840c7bf05a..d5dcf179da08 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRule.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRule.cs @@ -1,20 +1,14 @@ -// // 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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// - /// A rule for NAT - exposing a VM's port (backendPort) on the public IP + /// A rule for NAT - exposing a VM's port (backendPort) on the public IP /// address using a load balancer. /// public partial class InboundNatRule @@ -30,19 +24,23 @@ public InboundNatRule() /// /// Initializes a new instance of the InboundNatRule class. /// - /// The transport protocol for the - /// endpoint. Possible values include: 'Tcp', 'Udp' - /// The external endpoint port of the - /// inbound connection. Possible values range between 1 and 65535, - /// inclusive. If unspecified, a value will be allocated - /// automatically. - /// The port to which the external traffic - /// will be redirected. + + /// The transport protocol for the endpoint. + /// Possible values include: 'Tcp', 'Udp' + + /// The external endpoint port of the inbound connection. Possible values range + /// between 1 and 65535, inclusive. If unspecified, a value will be allocated + /// automatically. + /// + + /// The port to which the external traffic will be redirected. + /// public InboundNatRule(string transportProtocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?)) + { - TransportProtocol = transportProtocol; - FrontendPort = frontendPort; - BackendPort = backendPort; + this.TransportProtocol = transportProtocol; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; CustomInit(); } @@ -51,27 +49,25 @@ public InboundNatRule() /// partial void CustomInit(); + /// - /// Gets or sets the transport protocol for the endpoint. Possible - /// values include: 'Tcp', 'Udp' + /// Gets or sets the transport protocol for the endpoint. Possible values include: 'Tcp', 'Udp' /// - [JsonProperty(PropertyName = "transportProtocol")] - public string TransportProtocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "transportProtocol")] + public string TransportProtocol {get; set; } /// - /// Gets or sets the external endpoint port of the inbound connection. - /// Possible values range between 1 and 65535, inclusive. If - /// unspecified, a value will be allocated automatically. + /// Gets or sets the external endpoint port of the inbound connection. Possible + /// values range between 1 and 65535, inclusive. If unspecified, a value will + /// be allocated automatically. /// - [JsonProperty(PropertyName = "frontendPort")] - public int? FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public int? FrontendPort {get; set; } /// - /// Gets or sets the port to which the external traffic will be - /// redirected. + /// Gets or sets the port to which the external traffic will be redirected. /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRuleFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRuleFragment.cs index eed034717d84..830ae26c6ce0 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRuleFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRuleFragment.cs @@ -1,20 +1,14 @@ -// // 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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// - /// A rule for NAT - exposing a VM's port (backendPort) on the public IP + /// A rule for NAT - exposing a VM's port (backendPort) on the public IP /// address using a load balancer. /// public partial class InboundNatRuleFragment @@ -30,19 +24,23 @@ public InboundNatRuleFragment() /// /// Initializes a new instance of the InboundNatRuleFragment class. /// - /// The transport protocol for the - /// endpoint. Possible values include: 'Tcp', 'Udp' - /// The external endpoint port of the - /// inbound connection. Possible values range between 1 and 65535, - /// inclusive. If unspecified, a value will be allocated - /// automatically. - /// The port to which the external traffic - /// will be redirected. + + /// The transport protocol for the endpoint. + /// Possible values include: 'Tcp', 'Udp' + + /// The external endpoint port of the inbound connection. Possible values range + /// between 1 and 65535, inclusive. If unspecified, a value will be allocated + /// automatically. + /// + + /// The port to which the external traffic will be redirected. + /// public InboundNatRuleFragment(string transportProtocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?)) + { - TransportProtocol = transportProtocol; - FrontendPort = frontendPort; - BackendPort = backendPort; + this.TransportProtocol = transportProtocol; + this.FrontendPort = frontendPort; + this.BackendPort = backendPort; CustomInit(); } @@ -51,27 +49,25 @@ public InboundNatRuleFragment() /// partial void CustomInit(); + /// - /// Gets or sets the transport protocol for the endpoint. Possible - /// values include: 'Tcp', 'Udp' + /// Gets or sets the transport protocol for the endpoint. Possible values include: 'Tcp', 'Udp' /// - [JsonProperty(PropertyName = "transportProtocol")] - public string TransportProtocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "transportProtocol")] + public string TransportProtocol {get; set; } /// - /// Gets or sets the external endpoint port of the inbound connection. - /// Possible values range between 1 and 65535, inclusive. If - /// unspecified, a value will be allocated automatically. + /// Gets or sets the external endpoint port of the inbound connection. Possible + /// values range between 1 and 65535, inclusive. If unspecified, a value will + /// be allocated automatically. /// - [JsonProperty(PropertyName = "frontendPort")] - public int? FrontendPort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "frontendPort")] + public int? FrontendPort {get; set; } /// - /// Gets or sets the port to which the external traffic will be - /// redirected. + /// Gets or sets the port to which the external traffic will be redirected. /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Lab.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Lab.cs index bf9767e4c2e7..f82bc16acfa3 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Lab.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Lab.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A lab. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Lab : Resource { /// @@ -34,47 +24,70 @@ public Lab() /// /// Initializes a new instance of the Lab class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The lab's default storage - /// account. - /// The lab's default - /// premium storage account. - /// The lab's artifact storage - /// account. - /// The lab's premium data - /// disk storage account. - /// The lab's Key vault. - /// Type of storage used by the lab. It - /// can be either Premium or Standard. Default is Premium. Possible - /// values include: 'Standard', 'Premium' - /// The creation date of the lab. - /// The setting to enable usage of - /// premium data disks. - /// When its value is 'Enabled', creation of standard or premium data - /// disks is allowed. - /// When its value is 'Disabled', only creation of standard data disks - /// is allowed. Possible values include: 'Disabled', 'Enabled' - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Lab(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string defaultStorageAccount = default(string), string defaultPremiumStorageAccount = default(string), string artifactsStorageAccount = default(string), string premiumDataDiskStorageAccount = default(string), string vaultName = default(string), string labStorageType = default(string), System.DateTime? createdDate = default(System.DateTime?), string premiumDataDisks = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The lab's default storage account. + /// + + /// The lab's default premium storage account. + /// + + /// The lab's artifact storage account. + /// + + /// The lab's premium data disk storage account. + /// + + /// The lab's Key vault. + /// + + /// Type of storage used by the lab. It can be either Premium or Standard. + /// Default is Premium. + /// Possible values include: 'Standard', 'Premium' + + /// The creation date of the lab. + /// + + /// The setting to enable usage of premium data disks. + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. + /// Possible values include: 'Disabled', 'Enabled' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public Lab(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), string defaultStorageAccount = default(string), string defaultPremiumStorageAccount = default(string), string artifactsStorageAccount = default(string), string premiumDataDiskStorageAccount = default(string), string vaultName = default(string), string labStorageType = default(string), System.DateTime? createdDate = default(System.DateTime?), string premiumDataDisks = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - DefaultStorageAccount = defaultStorageAccount; - DefaultPremiumStorageAccount = defaultPremiumStorageAccount; - ArtifactsStorageAccount = artifactsStorageAccount; - PremiumDataDiskStorageAccount = premiumDataDiskStorageAccount; - VaultName = vaultName; - LabStorageType = labStorageType; - CreatedDate = createdDate; - PremiumDataDisks = premiumDataDisks; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.DefaultStorageAccount = defaultStorageAccount; + this.DefaultPremiumStorageAccount = defaultPremiumStorageAccount; + this.ArtifactsStorageAccount = artifactsStorageAccount; + this.PremiumDataDiskStorageAccount = premiumDataDiskStorageAccount; + this.VaultName = vaultName; + this.LabStorageType = labStorageType; + this.CreatedDate = createdDate; + this.PremiumDataDisks = premiumDataDisks; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -83,71 +96,70 @@ public Lab() /// partial void CustomInit(); + /// - /// Gets the lab's default storage account. + /// Gets the lab's default storage account. /// - [JsonProperty(PropertyName = "properties.defaultStorageAccount")] - public string DefaultStorageAccount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultStorageAccount")] + public string DefaultStorageAccount {get; private set; } /// - /// Gets the lab's default premium storage account. + /// Gets the lab's default premium storage account. /// - [JsonProperty(PropertyName = "properties.defaultPremiumStorageAccount")] - public string DefaultPremiumStorageAccount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultPremiumStorageAccount")] + public string DefaultPremiumStorageAccount {get; private set; } /// - /// Gets the lab's artifact storage account. + /// Gets the lab's artifact storage account. /// - [JsonProperty(PropertyName = "properties.artifactsStorageAccount")] - public string ArtifactsStorageAccount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactsStorageAccount")] + public string ArtifactsStorageAccount {get; private set; } /// - /// Gets the lab's premium data disk storage account. + /// Gets the lab's premium data disk storage account. /// - [JsonProperty(PropertyName = "properties.premiumDataDiskStorageAccount")] - public string PremiumDataDiskStorageAccount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.premiumDataDiskStorageAccount")] + public string PremiumDataDiskStorageAccount {get; private set; } /// - /// Gets the lab's Key vault. + /// Gets the lab's Key vault. /// - [JsonProperty(PropertyName = "properties.vaultName")] - public string VaultName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vaultName")] + public string VaultName {get; private set; } /// - /// Gets or sets type of storage used by the lab. It can be either - /// Premium or Standard. Default is Premium. Possible values include: - /// 'Standard', 'Premium' + /// Gets or sets type of storage used by the lab. It can be either Premium or + /// Standard. Default is Premium. Possible values include: 'Standard', 'Premium' /// - [JsonProperty(PropertyName = "properties.labStorageType")] - public string LabStorageType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labStorageType")] + public string LabStorageType {get; set; } /// /// Gets the creation date of the lab. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the setting to enable usage of premium data disks. - /// When its value is 'Enabled', creation of standard or premium data - /// disks is allowed. - /// When its value is 'Disabled', only creation of standard data disks - /// is allowed. Possible values include: 'Disabled', 'Enabled' + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "properties.premiumDataDisks")] - public string PremiumDataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.premiumDataDisks")] + public string PremiumDataDisks {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCost.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCost.cs index 183dd8ada447..165d221f1e42 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCost.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCost.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A cost item. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LabCost : Resource { /// @@ -34,40 +24,65 @@ public LabCost() /// /// Initializes a new instance of the LabCost class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The target cost properties - /// The lab cost summary component of the - /// cost data. - /// The lab cost details component of the - /// cost data. - /// The resource cost component of the cost - /// data. - /// The currency code of the cost. - /// The start time of the cost - /// data. - /// The end time of the cost data. - /// The creation date of the cost. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public LabCost(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), TargetCostProperties targetCost = default(TargetCostProperties), LabCostSummaryProperties labCostSummary = default(LabCostSummaryProperties), IList labCostDetails = default(IList), IList resourceCosts = default(IList), string currencyCode = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? endDateTime = default(System.DateTime?), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The target cost properties + /// + + /// The lab cost summary component of the cost data. + /// + + /// The lab cost details component of the cost data. + /// + + /// The resource cost component of the cost data. + /// + + /// The currency code of the cost. + /// + + /// The start time of the cost data. + /// + + /// The end time of the cost data. + /// + + /// The creation date of the cost. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabCost(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), TargetCostProperties targetCost = default(TargetCostProperties), LabCostSummaryProperties labCostSummary = default(LabCostSummaryProperties), System.Collections.Generic.IList labCostDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceCosts = default(System.Collections.Generic.IList), string currencyCode = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? endDateTime = default(System.DateTime?), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - TargetCost = targetCost; - LabCostSummary = labCostSummary; - LabCostDetails = labCostDetails; - ResourceCosts = resourceCosts; - CurrencyCode = currencyCode; - StartDateTime = startDateTime; - EndDateTime = endDateTime; - CreatedDate = createdDate; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.TargetCost = targetCost; + this.LabCostSummary = labCostSummary; + this.LabCostDetails = labCostDetails; + this.ResourceCosts = resourceCosts; + this.CurrencyCode = currencyCode; + this.StartDateTime = startDateTime; + this.EndDateTime = endDateTime; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -76,65 +91,65 @@ public LabCost() /// partial void CustomInit(); + /// /// Gets or sets the target cost properties /// - [JsonProperty(PropertyName = "properties.targetCost")] - public TargetCostProperties TargetCost { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetCost")] + public TargetCostProperties TargetCost {get; set; } /// /// Gets the lab cost summary component of the cost data. /// - [JsonProperty(PropertyName = "properties.labCostSummary")] - public LabCostSummaryProperties LabCostSummary { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labCostSummary")] + public LabCostSummaryProperties LabCostSummary {get; private set; } /// /// Gets the lab cost details component of the cost data. /// - [JsonProperty(PropertyName = "properties.labCostDetails")] - public IList LabCostDetails { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labCostDetails")] + public System.Collections.Generic.IList LabCostDetails {get; private set; } /// /// Gets the resource cost component of the cost data. /// - [JsonProperty(PropertyName = "properties.resourceCosts")] - public IList ResourceCosts { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceCosts")] + public System.Collections.Generic.IList ResourceCosts {get; private set; } /// /// Gets or sets the currency code of the cost. /// - [JsonProperty(PropertyName = "properties.currencyCode")] - public string CurrencyCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.currencyCode")] + public string CurrencyCode {get; set; } /// /// Gets or sets the start time of the cost data. /// - [JsonProperty(PropertyName = "properties.startDateTime")] - public System.DateTime? StartDateTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.startDateTime")] + public System.DateTime? StartDateTime {get; set; } /// /// Gets or sets the end time of the cost data. /// - [JsonProperty(PropertyName = "properties.endDateTime")] - public System.DateTime? EndDateTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endDateTime")] + public System.DateTime? EndDateTime {get; set; } /// /// Gets or sets the creation date of the cost. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostDetailsProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostDetailsProperties.cs index fea51529c23f..b566f2c4d70e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostDetailsProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostDetailsProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public LabCostDetailsProperties() /// /// Initializes a new instance of the LabCostDetailsProperties class. /// - /// The date of the cost item. - /// The cost component of the cost item. - /// The type of the cost. Possible values - /// include: 'Unavailable', 'Reported', 'Projected' + + /// The date of the cost item. + /// + + /// The cost component of the cost item. + /// + + /// The type of the cost. + /// Possible values include: 'Unavailable', 'Reported', 'Projected' public LabCostDetailsProperties(System.DateTime? date = default(System.DateTime?), double? cost = default(double?), string costType = default(string)) + { - Date = date; - Cost = cost; - CostType = costType; + this.Date = date; + this.Cost = cost; + this.CostType = costType; CustomInit(); } @@ -46,24 +46,23 @@ public LabCostDetailsProperties() /// partial void CustomInit(); + /// /// Gets or sets the date of the cost item. /// - [JsonProperty(PropertyName = "date")] - public System.DateTime? Date { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "date")] + public System.DateTime? Date {get; set; } /// /// Gets or sets the cost component of the cost item. /// - [JsonProperty(PropertyName = "cost")] - public double? Cost { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cost")] + public double? Cost {get; set; } /// - /// Gets or sets the type of the cost. Possible values include: - /// 'Unavailable', 'Reported', 'Projected' + /// Gets or sets the type of the cost. Possible values include: 'Unavailable', 'Reported', 'Projected' /// - [JsonProperty(PropertyName = "costType")] - public string CostType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "costType")] + public string CostType {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostProperties.cs new file mode 100644 index 000000000000..36756fa77542 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostProperties.cs @@ -0,0 +1,138 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a cost item. + /// + public partial class LabCostProperties + { + /// + /// Initializes a new instance of the LabCostProperties class. + /// + public LabCostProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabCostProperties class. + /// + + /// The target cost properties + /// + + /// The lab cost summary component of the cost data. + /// + + /// The lab cost details component of the cost data. + /// + + /// The resource cost component of the cost data. + /// + + /// The currency code of the cost. + /// + + /// The start time of the cost data. + /// + + /// The end time of the cost data. + /// + + /// The creation date of the cost. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabCostProperties(TargetCostProperties targetCost = default(TargetCostProperties), LabCostSummaryProperties labCostSummary = default(LabCostSummaryProperties), System.Collections.Generic.IList labCostDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceCosts = default(System.Collections.Generic.IList), string currencyCode = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? endDateTime = default(System.DateTime?), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.TargetCost = targetCost; + this.LabCostSummary = labCostSummary; + this.LabCostDetails = labCostDetails; + this.ResourceCosts = resourceCosts; + this.CurrencyCode = currencyCode; + this.StartDateTime = startDateTime; + this.EndDateTime = endDateTime; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the target cost properties + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetCost")] + public TargetCostProperties TargetCost {get; set; } + + /// + /// Gets the lab cost summary component of the cost data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labCostSummary")] + public LabCostSummaryProperties LabCostSummary {get; private set; } + + /// + /// Gets the lab cost details component of the cost data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labCostDetails")] + public System.Collections.Generic.IList LabCostDetails {get; private set; } + + /// + /// Gets the resource cost component of the cost data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceCosts")] + public System.Collections.Generic.IList ResourceCosts {get; private set; } + + /// + /// Gets or sets the currency code of the cost. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "currencyCode")] + public string CurrencyCode {get; set; } + + /// + /// Gets or sets the start time of the cost data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startDateTime")] + public System.DateTime? StartDateTime {get; set; } + + /// + /// Gets or sets the end time of the cost data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endDateTime")] + public System.DateTime? EndDateTime {get; set; } + + /// + /// Gets or sets the creation date of the cost. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostSummaryProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostSummaryProperties.cs index daf9adcbff0e..28b69fcc8c9a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostSummaryProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostSummaryProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public LabCostSummaryProperties() /// /// Initializes a new instance of the LabCostSummaryProperties class. /// - /// The cost component of the cost - /// item. + + /// The cost component of the cost item. + /// public LabCostSummaryProperties(double? estimatedLabCost = default(double?)) + { - EstimatedLabCost = estimatedLabCost; + this.EstimatedLabCost = estimatedLabCost; CustomInit(); } @@ -42,11 +38,11 @@ public LabCostSummaryProperties() /// partial void CustomInit(); + /// /// Gets or sets the cost component of the cost item. /// - [JsonProperty(PropertyName = "estimatedLabCost")] - public double? EstimatedLabCost { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "estimatedLabCost")] + public double? EstimatedLabCost {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabFragment.cs index b6e84b1cb8ae..23f1c4933ec2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A lab. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LabFragment : Resource { /// @@ -34,31 +24,46 @@ public LabFragment() /// /// Initializes a new instance of the LabFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// Type of storage used by the lab. It - /// can be either Premium or Standard. Default is Premium. Possible - /// values include: 'Standard', 'Premium' - /// The setting to enable usage of - /// premium data disks. - /// When its value is 'Enabled', creation of standard or premium data - /// disks is allowed. - /// When its value is 'Disabled', only creation of standard data disks - /// is allowed. Possible values include: 'Disabled', 'Enabled' - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public LabFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string labStorageType = default(string), string premiumDataDisks = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// Type of storage used by the lab. It can be either Premium or Standard. + /// Default is Premium. + /// Possible values include: 'Standard', 'Premium' + + /// The setting to enable usage of premium data disks. + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. + /// Possible values include: 'Disabled', 'Enabled' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabFragment(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), string labStorageType = default(string), string premiumDataDisks = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - LabStorageType = labStorageType; - PremiumDataDisks = premiumDataDisks; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.LabStorageType = labStorageType; + this.PremiumDataDisks = premiumDataDisks; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -67,35 +72,34 @@ public LabFragment() /// partial void CustomInit(); + /// - /// Gets or sets type of storage used by the lab. It can be either - /// Premium or Standard. Default is Premium. Possible values include: - /// 'Standard', 'Premium' + /// Gets or sets type of storage used by the lab. It can be either Premium or + /// Standard. Default is Premium. Possible values include: 'Standard', 'Premium' /// - [JsonProperty(PropertyName = "properties.labStorageType")] - public string LabStorageType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labStorageType")] + public string LabStorageType {get; set; } /// /// Gets or sets the setting to enable usage of premium data disks. - /// When its value is 'Enabled', creation of standard or premium data - /// disks is allowed. - /// When its value is 'Disabled', only creation of standard data disks - /// is allowed. Possible values include: 'Disabled', 'Enabled' + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "properties.premiumDataDisks")] - public string PremiumDataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.premiumDataDisks")] + public string PremiumDataDisks {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabProperties.cs new file mode 100644 index 000000000000..bd36554be812 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabProperties.cs @@ -0,0 +1,148 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a lab. + /// + public partial class LabProperties + { + /// + /// Initializes a new instance of the LabProperties class. + /// + public LabProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabProperties class. + /// + + /// The lab's default storage account. + /// + + /// The lab's default premium storage account. + /// + + /// The lab's artifact storage account. + /// + + /// The lab's premium data disk storage account. + /// + + /// The lab's Key vault. + /// + + /// Type of storage used by the lab. It can be either Premium or Standard. + /// Default is Premium. + /// Possible values include: 'Standard', 'Premium' + + /// The creation date of the lab. + /// + + /// The setting to enable usage of premium data disks. + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. + /// Possible values include: 'Disabled', 'Enabled' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabProperties(string defaultStorageAccount = default(string), string defaultPremiumStorageAccount = default(string), string artifactsStorageAccount = default(string), string premiumDataDiskStorageAccount = default(string), string vaultName = default(string), string labStorageType = default(string), System.DateTime? createdDate = default(System.DateTime?), string premiumDataDisks = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.DefaultStorageAccount = defaultStorageAccount; + this.DefaultPremiumStorageAccount = defaultPremiumStorageAccount; + this.ArtifactsStorageAccount = artifactsStorageAccount; + this.PremiumDataDiskStorageAccount = premiumDataDiskStorageAccount; + this.VaultName = vaultName; + this.LabStorageType = labStorageType; + this.CreatedDate = createdDate; + this.PremiumDataDisks = premiumDataDisks; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the lab's default storage account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultStorageAccount")] + public string DefaultStorageAccount {get; private set; } + + /// + /// Gets the lab's default premium storage account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPremiumStorageAccount")] + public string DefaultPremiumStorageAccount {get; private set; } + + /// + /// Gets the lab's artifact storage account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactsStorageAccount")] + public string ArtifactsStorageAccount {get; private set; } + + /// + /// Gets the lab's premium data disk storage account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "premiumDataDiskStorageAccount")] + public string PremiumDataDiskStorageAccount {get; private set; } + + /// + /// Gets the lab's Key vault. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vaultName")] + public string VaultName {get; private set; } + + /// + /// Gets or sets type of storage used by the lab. It can be either Premium or + /// Standard. Default is Premium. Possible values include: 'Standard', 'Premium' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labStorageType")] + public string LabStorageType {get; set; } + + /// + /// Gets the creation date of the lab. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the setting to enable usage of premium data disks. + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "premiumDataDisks")] + public string PremiumDataDisks {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabPropertiesFragment.cs new file mode 100644 index 000000000000..95e86f359521 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabPropertiesFragment.cs @@ -0,0 +1,88 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a lab. + /// + public partial class LabPropertiesFragment + { + /// + /// Initializes a new instance of the LabPropertiesFragment class. + /// + public LabPropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabPropertiesFragment class. + /// + + /// Type of storage used by the lab. It can be either Premium or Standard. + /// Default is Premium. + /// Possible values include: 'Standard', 'Premium' + + /// The setting to enable usage of premium data disks. + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. + /// Possible values include: 'Disabled', 'Enabled' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabPropertiesFragment(string labStorageType = default(string), string premiumDataDisks = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.LabStorageType = labStorageType; + this.PremiumDataDisks = premiumDataDisks; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets type of storage used by the lab. It can be either Premium or + /// Standard. Default is Premium. Possible values include: 'Standard', 'Premium' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labStorageType")] + public string LabStorageType {get; set; } + + /// + /// Gets or sets the setting to enable usage of premium data disks. + /// When its value is 'Enabled', creation of standard or premium data disks is + /// allowed. + /// When its value is 'Disabled', only creation of standard data disks is + /// allowed. Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "premiumDataDisks")] + public string PremiumDataDisks {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabResourceCostProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabResourceCostProperties.cs index 0f86d89962d6..d9c74625cb50 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabResourceCostProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabResourceCostProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,33 +23,45 @@ public LabResourceCostProperties() /// /// Initializes a new instance of the LabResourceCostProperties class. /// - /// The name of the resource. - /// The unique identifier of the - /// resource. - /// The cost component of the resource cost - /// item. - /// The logical resource type (ex. - /// virtualmachine, storageaccount) - /// The owner of the resource (ex. - /// janedoe@microsoft.com) - /// The category of the resource (ex. - /// Premium_LRS, Standard_DS1) - /// The status of the resource (ex. - /// Active) - /// The ID of the resource - /// The ID of the external - /// resource + + /// The name of the resource. + /// + + /// The unique identifier of the resource. + /// + + /// The cost component of the resource cost item. + /// + + /// The logical resource type (ex. virtualmachine, storageaccount) + /// + + /// The owner of the resource (ex. janedoe@microsoft.com) + /// + + /// The category of the resource (ex. Premium_LRS, Standard_DS1) + /// + + /// The status of the resource (ex. Active) + /// + + /// The ID of the resource + /// + + /// The ID of the external resource + /// public LabResourceCostProperties(string resourcename = default(string), string resourceUId = default(string), double? resourceCost = default(double?), string resourceType = default(string), string resourceOwner = default(string), string resourcePricingTier = default(string), string resourceStatus = default(string), string resourceId = default(string), string externalResourceId = default(string)) + { - Resourcename = resourcename; - ResourceUId = resourceUId; - ResourceCost = resourceCost; - ResourceType = resourceType; - ResourceOwner = resourceOwner; - ResourcePricingTier = resourcePricingTier; - ResourceStatus = resourceStatus; - ResourceId = resourceId; - ExternalResourceId = externalResourceId; + this.Resourcename = resourcename; + this.ResourceUId = resourceUId; + this.ResourceCost = resourceCost; + this.ResourceType = resourceType; + this.ResourceOwner = resourceOwner; + this.ResourcePricingTier = resourcePricingTier; + this.ResourceStatus = resourceStatus; + this.ResourceId = resourceId; + this.ExternalResourceId = externalResourceId; CustomInit(); } @@ -64,61 +70,59 @@ public LabResourceCostProperties() /// partial void CustomInit(); + /// /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "resourcename")] - public string Resourcename { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourcename")] + public string Resourcename {get; set; } /// /// Gets or sets the unique identifier of the resource. /// - [JsonProperty(PropertyName = "resourceUId")] - public string ResourceUId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUId")] + public string ResourceUId {get; set; } /// /// Gets or sets the cost component of the resource cost item. /// - [JsonProperty(PropertyName = "resourceCost")] - public double? ResourceCost { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceCost")] + public double? ResourceCost {get; set; } /// - /// Gets or sets the logical resource type (ex. virtualmachine, - /// storageaccount) + /// Gets or sets the logical resource type (ex. virtualmachine, storageaccount) /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; set; } /// /// Gets or sets the owner of the resource (ex. janedoe@microsoft.com) /// - [JsonProperty(PropertyName = "resourceOwner")] - public string ResourceOwner { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceOwner")] + public string ResourceOwner {get; set; } /// - /// Gets or sets the category of the resource (ex. Premium_LRS, - /// Standard_DS1) + /// Gets or sets the category of the resource (ex. Premium_LRS, Standard_DS1) /// - [JsonProperty(PropertyName = "resourcePricingTier")] - public string ResourcePricingTier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourcePricingTier")] + public string ResourcePricingTier {get; set; } /// /// Gets or sets the status of the resource (ex. Active) /// - [JsonProperty(PropertyName = "resourceStatus")] - public string ResourceStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceStatus")] + public string ResourceStatus {get; set; } /// /// Gets or sets the ID of the resource /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the ID of the external resource /// - [JsonProperty(PropertyName = "externalResourceId")] - public string ExternalResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "externalResourceId")] + public string ExternalResourceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVhd.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVhd.cs index b95d812861e2..f72ce4fc7d14 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVhd.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVhd.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public LabVhd() /// /// Initializes a new instance of the LabVhd class. /// - /// The URI to the VHD. + + /// The URI to the VHD. + /// public LabVhd(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -41,11 +38,11 @@ public LabVhd() /// partial void CustomInit(); + /// /// Gets or sets the URI to the VHD. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachine.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachine.cs index 1508160c0869..03fedc82a677 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachine.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachine.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A virtual machine. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LabVirtualMachine : Resource { /// @@ -34,104 +24,151 @@ public LabVirtualMachine() /// /// Initializes a new instance of the LabVirtualMachine class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The notes of the virtual machine. - /// The object identifier of the owner of - /// the virtual machine. - /// The user principal name of the - /// virtual machine owner. - /// The object identifier of the creator - /// of the virtual machine. - /// The email address of creator of the - /// virtual machine. - /// The creation date of the virtual - /// machine. - /// The resource identifier (Microsoft.Compute) - /// of the virtual machine. - /// The custom image identifier of the - /// virtual machine. - /// The OS type of the virtual machine. - /// The size of the virtual machine. - /// The user name of the virtual - /// machine. - /// The password of the virtual machine - /// administrator. - /// The SSH key of the virtual machine - /// administrator. - /// Indicates whether this - /// virtual machine uses an SSH key for authentication. - /// The fully-qualified domain name of the virtual - /// machine. - /// The lab subnet name of the virtual - /// machine. - /// The lab virtual network - /// identifier of the virtual machine. - /// Indicates whether the virtual - /// machine is to be created without a public IP address. - /// The artifacts to be installed on the - /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. - /// The compute virtual machine - /// properties. - /// The network interface - /// properties. - /// The applicable schedule for the - /// virtual machine. - /// The expiration date for VM. - /// Indicates whether another user can take - /// ownership of the virtual machine - /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). - /// Tells source of creation - /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' - /// The resource ID of the environment that - /// contains this virtual machine, if any. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public LabVirtualMachine(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), ComputeVmProperties computeVm = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The applicable schedule for the virtual machine. + /// + + /// The notes of the virtual machine. + /// + + /// The object identifier of the owner of the virtual machine. + /// + + /// The user principal name of the virtual machine owner. + /// + + /// The object identifier of the creator of the virtual machine. + /// + + /// The email address of creator of the virtual machine. + /// + + /// The creation date of the virtual machine. + /// + + /// The resource identifier (Microsoft.Compute) of the virtual machine. + /// + + /// The custom image identifier of the virtual machine. + /// + + /// The OS type of the virtual machine. + /// + + /// The size of the virtual machine. + /// + + /// The user name of the virtual machine. + /// + + /// The password of the virtual machine administrator. + /// + + /// The SSH key of the virtual machine administrator. + /// + + /// Indicates whether this virtual machine uses an SSH key for authentication. + /// + + /// The fully-qualified domain name of the virtual machine. + /// + + /// The lab subnet name of the virtual machine. + /// + + /// The lab virtual network identifier of the virtual machine. + /// + + /// Indicates whether the virtual machine is to be created without a public IP + /// address. + /// + + /// The artifacts to be installed on the virtual machine. + /// + + /// The artifact deployment status for the virtual machine. + /// + + /// The Microsoft Azure Marketplace image reference of the virtual machine. + /// + + /// The compute virtual machine properties. + /// + + /// The network interface properties. + /// + + /// The expiration date for VM. + /// + + /// Indicates whether another user can take ownership of the virtual machine + /// + + /// Storage type to use for virtual machine (i.e. Standard, Premium). + /// + + /// Tells source of creation of lab virtual machine. Output property only. + /// Possible values include: 'FromCustomImage', 'FromGalleryImage' + + /// The resource ID of the environment that contains this virtual machine, if + /// any. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabVirtualMachine(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), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIPAddress = default(bool?), System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), ComputeVmProperties computeVM = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Notes = notes; - OwnerObjectId = ownerObjectId; - OwnerUserPrincipalName = ownerUserPrincipalName; - CreatedByUserId = createdByUserId; - CreatedByUser = createdByUser; - CreatedDate = createdDate; - ComputeId = computeId; - CustomImageId = customImageId; - OsType = osType; - Size = size; - UserName = userName; - Password = password; - SshKey = sshKey; - IsAuthenticationWithSshKey = isAuthenticationWithSshKey; - Fqdn = fqdn; - LabSubnetName = labSubnetName; - LabVirtualNetworkId = labVirtualNetworkId; - DisallowPublicIpAddress = disallowPublicIpAddress; - Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; - ComputeVm = computeVm; - NetworkInterface = networkInterface; - ApplicableSchedule = applicableSchedule; - ExpirationDate = expirationDate; - AllowClaim = allowClaim; - StorageType = storageType; - VirtualMachineCreationSource = virtualMachineCreationSource; - EnvironmentId = environmentId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.ApplicableSchedule = applicableSchedule; + this.Notes = notes; + this.OwnerObjectId = ownerObjectId; + this.OwnerUserPrincipalName = ownerUserPrincipalName; + this.CreatedByUserId = createdByUserId; + this.CreatedByUser = createdByUser; + this.CreatedDate = createdDate; + this.ComputeId = computeId; + this.CustomImageId = customImageId; + this.OSType = osType; + this.Size = size; + this.UserName = userName; + this.Password = password; + this.SshKey = sshKey; + this.IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + this.Fqdn = fqdn; + this.LabSubnetName = labSubnetName; + this.LabVirtualNetworkId = labVirtualNetworkId; + this.DisallowPublicIPAddress = disallowPublicIPAddress; + this.Artifacts = artifacts; + this.ArtifactDeploymentStatus = artifactDeploymentStatus; + this.GalleryImageReference = galleryImageReference; + this.ComputeVM = computeVM; + this.NetworkInterface = networkInterface; + this.ExpirationDate = expirationDate; + this.AllowClaim = allowClaim; + this.StorageType = storageType; + this.VirtualMachineCreationSource = virtualMachineCreationSource; + this.EnvironmentId = environmentId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -140,205 +177,198 @@ public LabVirtualMachine() /// partial void CustomInit(); + + /// + /// Gets or sets the applicable schedule for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicableSchedule")] + public ApplicableSchedule ApplicableSchedule {get; set; } + /// /// Gets or sets the notes of the virtual machine. /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notes")] + public string Notes {get; set; } /// - /// Gets or sets the object identifier of the owner of the virtual - /// machine. + /// Gets or sets the object identifier of the owner of the virtual machine. /// - [JsonProperty(PropertyName = "properties.ownerObjectId")] - public string OwnerObjectId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ownerObjectId")] + public string OwnerObjectId {get; set; } /// /// Gets or sets the user principal name of the virtual machine owner. /// - [JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] - public string OwnerUserPrincipalName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] + public string OwnerUserPrincipalName {get; set; } /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. + /// Gets or sets the object identifier of the creator of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUserId")] + public string CreatedByUserId {get; set; } /// /// Gets or sets the email address of creator of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUser")] + public string CreatedByUser {get; set; } /// /// Gets or sets the creation date of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; set; } /// - /// Gets the resource identifier (Microsoft.Compute) of the virtual - /// machine. + /// Gets the resource identifier (Microsoft.Compute) of the virtual machine. /// - [JsonProperty(PropertyName = "properties.computeId")] - public string ComputeId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.computeId")] + public string ComputeId {get; private set; } /// /// Gets or sets the custom image identifier of the virtual machine. /// - [JsonProperty(PropertyName = "properties.customImageId")] - public string CustomImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customImageId")] + public string CustomImageId {get; set; } /// /// Gets or sets the OS type of the virtual machine. /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public string OSType {get; set; } /// /// Gets or sets the size of the virtual machine. /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public string Size {get; set; } /// /// Gets or sets the user name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.userName")] + public string UserName {get; set; } /// /// Gets or sets the password of the virtual machine administrator. /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.password")] + public string Password {get; set; } /// /// Gets or sets the SSH key of the virtual machine administrator. /// - [JsonProperty(PropertyName = "properties.sshKey")] - public string SshKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sshKey")] + public string SshKey {get; set; } /// - /// Gets or sets indicates whether this virtual machine uses an SSH key - /// for authentication. + /// Gets or sets indicates whether this virtual machine uses an SSH key for + /// authentication. /// - [JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] - public bool? IsAuthenticationWithSshKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey {get; set; } /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. + /// Gets or sets the fully-qualified domain name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdn")] + public string Fqdn {get; set; } /// /// Gets or sets the lab subnet name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets the lab virtual network identifier of the virtual - /// machine. + /// Gets or sets the lab virtual network identifier of the virtual machine. /// - [JsonProperty(PropertyName = "properties.labVirtualNetworkId")] - public string LabVirtualNetworkId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVirtualNetworkId")] + public string LabVirtualNetworkId {get; set; } /// - /// Gets or sets indicates whether the virtual machine is to be created - /// without a public IP address. + /// Gets or sets indicates whether the virtual machine is to be created without + /// a public IP address. /// - [JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] - public bool? DisallowPublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] + public bool? DisallowPublicIPAddress {get; set; } /// /// Gets or sets the artifacts to be installed on the virtual machine. /// - [JsonProperty(PropertyName = "properties.artifacts")] - public IList Artifacts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. + /// Gets or sets the artifact deployment status for the virtual machine. /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] + public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus {get; set; } /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. + /// Gets or sets the Microsoft Azure Marketplace image reference of the virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReference GalleryImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.galleryImageReference")] + public GalleryImageReference GalleryImageReference {get; set; } /// /// Gets or sets the compute virtual machine properties. /// - [JsonProperty(PropertyName = "properties.computeVm")] - public ComputeVmProperties ComputeVm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.computeVm")] + public ComputeVmProperties ComputeVM {get; set; } /// /// Gets or sets the network interface properties. /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfaceProperties NetworkInterface { get; set; } - - /// - /// Gets or sets the applicable schedule for the virtual machine. - /// - [JsonProperty(PropertyName = "properties.applicableSchedule")] - public ApplicableSchedule ApplicableSchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterface")] + public NetworkInterfaceProperties NetworkInterface {get; set; } /// /// Gets or sets the expiration date for VM. /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expirationDate")] + public System.DateTime? ExpirationDate {get; set; } /// - /// Gets or sets indicates whether another user can take ownership of - /// the virtual machine + /// Gets or sets indicates whether another user can take ownership of the + /// virtual machine /// - [JsonProperty(PropertyName = "properties.allowClaim")] - public bool? AllowClaim { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowClaim")] + public bool? AllowClaim {get; set; } /// - /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). + /// Gets or sets storage type to use for virtual machine (i.e. Standard, + /// Premium). /// - [JsonProperty(PropertyName = "properties.storageType")] - public string StorageType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageType")] + public string StorageType {get; set; } /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' + /// Gets or sets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' /// - [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] + public string VirtualMachineCreationSource {get; set; } /// - /// Gets or sets the resource ID of the environment that contains this - /// virtual machine, if any. + /// Gets or sets the resource ID of the environment that contains this virtual + /// machine, if any. /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.environmentId")] + public string EnvironmentId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameter.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameter.cs index 0203eeee9632..7b93f0eba553 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameter.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameter.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Properties for creating a virtual machine. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LabVirtualMachineCreationParameter { /// - /// Initializes a new instance of the - /// LabVirtualMachineCreationParameter class. + /// Initializes a new instance of the LabVirtualMachineCreationParameter class. /// public LabVirtualMachineCreationParameter() { @@ -33,109 +22,149 @@ public LabVirtualMachineCreationParameter() } /// - /// Initializes a new instance of the - /// LabVirtualMachineCreationParameter class. - /// - /// The number of virtual machine - /// instances to create. - /// The notes of the virtual machine. - /// The object identifier of the owner of - /// the virtual machine. - /// The user principal name of the - /// virtual machine owner. - /// The object identifier of the creator - /// of the virtual machine. - /// The email address of creator of the - /// virtual machine. - /// The creation date of the virtual - /// machine. - /// The custom image identifier of the - /// virtual machine. - /// The OS type of the virtual machine. - /// The size of the virtual machine. - /// The user name of the virtual - /// machine. - /// The password of the virtual machine - /// administrator. - /// The SSH key of the virtual machine - /// administrator. - /// Indicates whether this - /// virtual machine uses an SSH key for authentication. - /// The fully-qualified domain name of the virtual - /// machine. - /// The lab subnet name of the virtual - /// machine. - /// The lab virtual network - /// identifier of the virtual machine. - /// Indicates whether the virtual - /// machine is to be created without a public IP address. - /// The artifacts to be installed on the - /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. - /// The compute virtual machine - /// properties. - /// The network interface - /// properties. - /// The applicable schedule for the - /// virtual machine. - /// The expiration date for VM. - /// Indicates whether another user can take - /// ownership of the virtual machine - /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). - /// Tells source of creation - /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' - /// The resource ID of the environment that - /// contains this virtual machine, if any. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - /// The name of the virtual machine or - /// environment - /// The location of the new virtual machine or - /// environment - /// The tags of the resource. - public LabVirtualMachineCreationParameter(BulkCreationParameters bulkCreationParameters = default(BulkCreationParameters), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), ComputeVmProperties computeVm = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + /// Initializes a new instance of the LabVirtualMachineCreationParameter class. + /// + + /// The name of the virtual machine or environment + /// + + /// The location of the new virtual machine or environment + /// + + /// The tags of the resource. + /// + + /// The applicable schedule for the virtual machine. + /// + + /// The number of virtual machine instances to create. + /// + + /// The notes of the virtual machine. + /// + + /// The object identifier of the owner of the virtual machine. + /// + + /// The user principal name of the virtual machine owner. + /// + + /// The object identifier of the creator of the virtual machine. + /// + + /// The email address of creator of the virtual machine. + /// + + /// The creation date of the virtual machine. + /// + + /// The custom image identifier of the virtual machine. + /// + + /// The OS type of the virtual machine. + /// + + /// The size of the virtual machine. + /// + + /// The user name of the virtual machine. + /// + + /// The password of the virtual machine administrator. + /// + + /// The SSH key of the virtual machine administrator. + /// + + /// Indicates whether this virtual machine uses an SSH key for authentication. + /// + + /// The fully-qualified domain name of the virtual machine. + /// + + /// The lab subnet name of the virtual machine. + /// + + /// The lab virtual network identifier of the virtual machine. + /// + + /// Indicates whether the virtual machine is to be created without a public IP + /// address. + /// + + /// The artifacts to be installed on the virtual machine. + /// + + /// The artifact deployment status for the virtual machine. + /// + + /// The Microsoft Azure Marketplace image reference of the virtual machine. + /// + + /// The compute virtual machine properties. + /// + + /// The network interface properties. + /// + + /// The expiration date for VM. + /// + + /// Indicates whether another user can take ownership of the virtual machine + /// + + /// Storage type to use for virtual machine (i.e. Standard, Premium). + /// + + /// Tells source of creation of lab virtual machine. Output property only. + /// Possible values include: 'FromCustomImage', 'FromGalleryImage' + + /// The resource ID of the environment that contains this virtual machine, if + /// any. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabVirtualMachineCreationParameter(string name = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), BulkCreationParameters bulkCreationParameters = default(BulkCreationParameters), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIPAddress = default(bool?), System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), ComputeVmProperties computeVM = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + { - BulkCreationParameters = bulkCreationParameters; - Notes = notes; - OwnerObjectId = ownerObjectId; - OwnerUserPrincipalName = ownerUserPrincipalName; - CreatedByUserId = createdByUserId; - CreatedByUser = createdByUser; - CreatedDate = createdDate; - CustomImageId = customImageId; - OsType = osType; - Size = size; - UserName = userName; - Password = password; - SshKey = sshKey; - IsAuthenticationWithSshKey = isAuthenticationWithSshKey; - Fqdn = fqdn; - LabSubnetName = labSubnetName; - LabVirtualNetworkId = labVirtualNetworkId; - DisallowPublicIpAddress = disallowPublicIpAddress; - Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; - ComputeVm = computeVm; - NetworkInterface = networkInterface; - ApplicableSchedule = applicableSchedule; - ExpirationDate = expirationDate; - AllowClaim = allowClaim; - StorageType = storageType; - VirtualMachineCreationSource = virtualMachineCreationSource; - EnvironmentId = environmentId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; - Name = name; - Location = location; - Tags = tags; + this.Name = name; + this.Location = location; + this.Tags = tags; + this.ApplicableSchedule = applicableSchedule; + this.BulkCreationParameters = bulkCreationParameters; + this.Notes = notes; + this.OwnerObjectId = ownerObjectId; + this.OwnerUserPrincipalName = ownerUserPrincipalName; + this.CreatedByUserId = createdByUserId; + this.CreatedByUser = createdByUser; + this.CreatedDate = createdDate; + this.CustomImageId = customImageId; + this.OSType = osType; + this.Size = size; + this.UserName = userName; + this.Password = password; + this.SshKey = sshKey; + this.IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + this.Fqdn = fqdn; + this.LabSubnetName = labSubnetName; + this.LabVirtualNetworkId = labVirtualNetworkId; + this.DisallowPublicIPAddress = disallowPublicIPAddress; + this.Artifacts = artifacts; + this.ArtifactDeploymentStatus = artifactDeploymentStatus; + this.GalleryImageReference = galleryImageReference; + this.ComputeVM = computeVM; + this.NetworkInterface = networkInterface; + this.ExpirationDate = expirationDate; + this.AllowClaim = allowClaim; + this.StorageType = storageType; + this.VirtualMachineCreationSource = virtualMachineCreationSource; + this.EnvironmentId = environmentId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -144,222 +173,216 @@ public LabVirtualMachineCreationParameter() /// partial void CustomInit(); + + /// + /// Gets or sets the name of the virtual machine or environment + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the location of the new virtual machine or environment + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets the tags of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the applicable schedule for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicableSchedule")] + public ApplicableSchedule ApplicableSchedule {get; set; } + /// /// Gets or sets the number of virtual machine instances to create. /// - [JsonProperty(PropertyName = "properties.bulkCreationParameters")] - public BulkCreationParameters BulkCreationParameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bulkCreationParameters")] + public BulkCreationParameters BulkCreationParameters {get; set; } /// /// Gets or sets the notes of the virtual machine. /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notes")] + public string Notes {get; set; } /// - /// Gets or sets the object identifier of the owner of the virtual - /// machine. + /// Gets or sets the object identifier of the owner of the virtual machine. /// - [JsonProperty(PropertyName = "properties.ownerObjectId")] - public string OwnerObjectId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ownerObjectId")] + public string OwnerObjectId {get; set; } /// /// Gets or sets the user principal name of the virtual machine owner. /// - [JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] - public string OwnerUserPrincipalName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] + public string OwnerUserPrincipalName {get; set; } /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. + /// Gets or sets the object identifier of the creator of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUserId")] + public string CreatedByUserId {get; set; } /// /// Gets or sets the email address of creator of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUser")] + public string CreatedByUser {get; set; } /// /// Gets or sets the creation date of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; set; } /// /// Gets or sets the custom image identifier of the virtual machine. /// - [JsonProperty(PropertyName = "properties.customImageId")] - public string CustomImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customImageId")] + public string CustomImageId {get; set; } /// /// Gets or sets the OS type of the virtual machine. /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public string OSType {get; set; } /// /// Gets or sets the size of the virtual machine. /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public string Size {get; set; } /// /// Gets or sets the user name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.userName")] + public string UserName {get; set; } /// /// Gets or sets the password of the virtual machine administrator. /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.password")] + public string Password {get; set; } /// /// Gets or sets the SSH key of the virtual machine administrator. /// - [JsonProperty(PropertyName = "properties.sshKey")] - public string SshKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sshKey")] + public string SshKey {get; set; } /// - /// Gets or sets indicates whether this virtual machine uses an SSH key - /// for authentication. + /// Gets or sets indicates whether this virtual machine uses an SSH key for + /// authentication. /// - [JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] - public bool? IsAuthenticationWithSshKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey {get; set; } /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. + /// Gets or sets the fully-qualified domain name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdn")] + public string Fqdn {get; set; } /// /// Gets or sets the lab subnet name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets the lab virtual network identifier of the virtual - /// machine. + /// Gets or sets the lab virtual network identifier of the virtual machine. /// - [JsonProperty(PropertyName = "properties.labVirtualNetworkId")] - public string LabVirtualNetworkId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVirtualNetworkId")] + public string LabVirtualNetworkId {get; set; } /// - /// Gets or sets indicates whether the virtual machine is to be created - /// without a public IP address. + /// Gets or sets indicates whether the virtual machine is to be created without + /// a public IP address. /// - [JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] - public bool? DisallowPublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] + public bool? DisallowPublicIPAddress {get; set; } /// /// Gets or sets the artifacts to be installed on the virtual machine. /// - [JsonProperty(PropertyName = "properties.artifacts")] - public IList Artifacts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. + /// Gets or sets the artifact deployment status for the virtual machine. /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] + public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus {get; set; } /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. + /// Gets or sets the Microsoft Azure Marketplace image reference of the virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReference GalleryImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.galleryImageReference")] + public GalleryImageReference GalleryImageReference {get; set; } /// /// Gets or sets the compute virtual machine properties. /// - [JsonProperty(PropertyName = "properties.computeVm")] - public ComputeVmProperties ComputeVm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.computeVm")] + public ComputeVmProperties ComputeVM {get; set; } /// /// Gets or sets the network interface properties. /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfaceProperties NetworkInterface { get; set; } - - /// - /// Gets or sets the applicable schedule for the virtual machine. - /// - [JsonProperty(PropertyName = "properties.applicableSchedule")] - public ApplicableSchedule ApplicableSchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterface")] + public NetworkInterfaceProperties NetworkInterface {get; set; } /// /// Gets or sets the expiration date for VM. /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expirationDate")] + public System.DateTime? ExpirationDate {get; set; } /// - /// Gets or sets indicates whether another user can take ownership of - /// the virtual machine + /// Gets or sets indicates whether another user can take ownership of the + /// virtual machine /// - [JsonProperty(PropertyName = "properties.allowClaim")] - public bool? AllowClaim { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowClaim")] + public bool? AllowClaim {get; set; } /// - /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). + /// Gets or sets storage type to use for virtual machine (i.e. Standard, + /// Premium). /// - [JsonProperty(PropertyName = "properties.storageType")] - public string StorageType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageType")] + public string StorageType {get; set; } /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' + /// Gets or sets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' /// - [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] + public string VirtualMachineCreationSource {get; set; } /// - /// Gets or sets the resource ID of the environment that contains this - /// virtual machine, if any. + /// Gets or sets the resource ID of the environment that contains this virtual + /// machine, if any. /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.environmentId")] + public string EnvironmentId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - - /// - /// Gets or sets the name of the virtual machine or environment - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the location of the new virtual machine or environment - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the tags of the resource. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameterProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameterProperties.cs new file mode 100644 index 000000000000..6d1152d4946a --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameterProperties.cs @@ -0,0 +1,357 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties for virtual machine creation. + /// + public partial class LabVirtualMachineCreationParameterProperties + { + /// + /// Initializes a new instance of the LabVirtualMachineCreationParameterProperties class. + /// + public LabVirtualMachineCreationParameterProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabVirtualMachineCreationParameterProperties class. + /// + + /// The number of virtual machine instances to create. + /// + + /// The notes of the virtual machine. + /// + + /// The object identifier of the owner of the virtual machine. + /// + + /// The user principal name of the virtual machine owner. + /// + + /// The object identifier of the creator of the virtual machine. + /// + + /// The email address of creator of the virtual machine. + /// + + /// The creation date of the virtual machine. + /// + + /// The custom image identifier of the virtual machine. + /// + + /// The OS type of the virtual machine. + /// + + /// The size of the virtual machine. + /// + + /// The user name of the virtual machine. + /// + + /// The password of the virtual machine administrator. + /// + + /// The SSH key of the virtual machine administrator. + /// + + /// Indicates whether this virtual machine uses an SSH key for authentication. + /// + + /// The fully-qualified domain name of the virtual machine. + /// + + /// The lab subnet name of the virtual machine. + /// + + /// The lab virtual network identifier of the virtual machine. + /// + + /// Indicates whether the virtual machine is to be created without a public IP + /// address. + /// + + /// The artifacts to be installed on the virtual machine. + /// + + /// The artifact deployment status for the virtual machine. + /// + + /// The Microsoft Azure Marketplace image reference of the virtual machine. + /// + + /// The compute virtual machine properties. + /// + + /// The network interface properties. + /// + + /// The applicable schedule for the virtual machine. + /// + + /// The expiration date for VM. + /// + + /// Indicates whether another user can take ownership of the virtual machine + /// + + /// Storage type to use for virtual machine (i.e. Standard, Premium). + /// + + /// Tells source of creation of lab virtual machine. Output property only. + /// Possible values include: 'FromCustomImage', 'FromGalleryImage' + + /// The resource ID of the environment that contains this virtual machine, if + /// any. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabVirtualMachineCreationParameterProperties(BulkCreationParameters bulkCreationParameters = default(BulkCreationParameters), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIPAddress = default(bool?), System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), ComputeVmProperties computeVM = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.BulkCreationParameters = bulkCreationParameters; + this.Notes = notes; + this.OwnerObjectId = ownerObjectId; + this.OwnerUserPrincipalName = ownerUserPrincipalName; + this.CreatedByUserId = createdByUserId; + this.CreatedByUser = createdByUser; + this.CreatedDate = createdDate; + this.CustomImageId = customImageId; + this.OSType = osType; + this.Size = size; + this.UserName = userName; + this.Password = password; + this.SshKey = sshKey; + this.IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + this.Fqdn = fqdn; + this.LabSubnetName = labSubnetName; + this.LabVirtualNetworkId = labVirtualNetworkId; + this.DisallowPublicIPAddress = disallowPublicIPAddress; + this.Artifacts = artifacts; + this.ArtifactDeploymentStatus = artifactDeploymentStatus; + this.GalleryImageReference = galleryImageReference; + this.ComputeVM = computeVM; + this.NetworkInterface = networkInterface; + this.ApplicableSchedule = applicableSchedule; + this.ExpirationDate = expirationDate; + this.AllowClaim = allowClaim; + this.StorageType = storageType; + this.VirtualMachineCreationSource = virtualMachineCreationSource; + this.EnvironmentId = environmentId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the number of virtual machine instances to create. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bulkCreationParameters")] + public BulkCreationParameters BulkCreationParameters {get; set; } + + /// + /// Gets or sets the notes of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notes")] + public string Notes {get; set; } + + /// + /// Gets or sets the object identifier of the owner of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerObjectId")] + public string OwnerObjectId {get; set; } + + /// + /// Gets or sets the user principal name of the virtual machine owner. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerUserPrincipalName")] + public string OwnerUserPrincipalName {get; set; } + + /// + /// Gets or sets the object identifier of the creator of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUserId")] + public string CreatedByUserId {get; set; } + + /// + /// Gets or sets the email address of creator of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUser")] + public string CreatedByUser {get; set; } + + /// + /// Gets or sets the creation date of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; set; } + + /// + /// Gets or sets the custom image identifier of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customImageId")] + public string CustomImageId {get; set; } + + /// + /// Gets or sets the OS type of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } + + /// + /// Gets or sets the size of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; set; } + + /// + /// Gets or sets the user name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userName")] + public string UserName {get; set; } + + /// + /// Gets or sets the password of the virtual machine administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + public string Password {get; set; } + + /// + /// Gets or sets the SSH key of the virtual machine administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sshKey")] + public string SshKey {get; set; } + + /// + /// Gets or sets indicates whether this virtual machine uses an SSH key for + /// authentication. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey {get; set; } + + /// + /// Gets or sets the fully-qualified domain name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } + + /// + /// Gets or sets the lab subnet name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } + + /// + /// Gets or sets the lab virtual network identifier of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVirtualNetworkId")] + public string LabVirtualNetworkId {get; set; } + + /// + /// Gets or sets indicates whether the virtual machine is to be created without + /// a public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowPublicIpAddress")] + public bool? DisallowPublicIPAddress {get; set; } + + /// + /// Gets or sets the artifacts to be installed on the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } + + /// + /// Gets or sets the artifact deployment status for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactDeploymentStatus")] + public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus {get; set; } + + /// + /// Gets or sets the Microsoft Azure Marketplace image reference of the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "galleryImageReference")] + public GalleryImageReference GalleryImageReference {get; set; } + + /// + /// Gets or sets the compute virtual machine properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "computeVm")] + public ComputeVmProperties ComputeVM {get; set; } + + /// + /// Gets or sets the network interface properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterface")] + public NetworkInterfaceProperties NetworkInterface {get; set; } + + /// + /// Gets or sets the applicable schedule for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicableSchedule")] + public ApplicableSchedule ApplicableSchedule {get; set; } + + /// + /// Gets or sets the expiration date for VM. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expirationDate")] + public System.DateTime? ExpirationDate {get; set; } + + /// + /// Gets or sets indicates whether another user can take ownership of the + /// virtual machine + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowClaim")] + public bool? AllowClaim {get; set; } + + /// + /// Gets or sets storage type to use for virtual machine (i.e. Standard, + /// Premium). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageType")] + public string StorageType {get; set; } + + /// + /// Gets or sets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineCreationSource")] + public string VirtualMachineCreationSource {get; set; } + + /// + /// Gets or sets the resource ID of the environment that contains this virtual + /// machine, if any. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "environmentId")] + public string EnvironmentId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineFragment.cs index 992cbff8c67b..1179a08dcbe4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A virtual machine. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LabVirtualMachineFragment : Resource { /// @@ -34,101 +24,147 @@ public LabVirtualMachineFragment() /// /// Initializes a new instance of the LabVirtualMachineFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The notes of the virtual machine. - /// The object identifier of the owner of - /// the virtual machine. - /// The user principal name of the - /// virtual machine owner. - /// The object identifier of the creator - /// of the virtual machine. - /// The email address of creator of the - /// virtual machine. - /// The creation date of the virtual - /// machine. - /// The custom image identifier of the - /// virtual machine. - /// The OS type of the virtual machine. - /// The size of the virtual machine. - /// The user name of the virtual - /// machine. - /// The password of the virtual machine - /// administrator. - /// The SSH key of the virtual machine - /// administrator. - /// Indicates whether this - /// virtual machine uses an SSH key for authentication. - /// The fully-qualified domain name of the virtual - /// machine. - /// The lab subnet name of the virtual - /// machine. - /// The lab virtual network - /// identifier of the virtual machine. - /// Indicates whether the virtual - /// machine is to be created without a public IP address. - /// The artifacts to be installed on the - /// virtual machine. - /// The artifact deployment - /// status for the virtual machine. - /// The Microsoft Azure Marketplace - /// image reference of the virtual machine. - /// The compute virtual machine - /// properties. - /// The network interface - /// properties. - /// The applicable schedule for the - /// virtual machine. - /// The expiration date for VM. - /// Indicates whether another user can take - /// ownership of the virtual machine - /// Storage type to use for virtual machine - /// (i.e. Standard, Premium). - /// Tells source of creation - /// of lab virtual machine. Output property only. Possible values - /// include: 'FromCustomImage', 'FromGalleryImage' - /// The resource ID of the environment that - /// contains this virtual machine, if any. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public LabVirtualMachineFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIpAddress = default(bool?), IList artifacts = default(IList), ArtifactDeploymentStatusPropertiesFragment artifactDeploymentStatus = default(ArtifactDeploymentStatusPropertiesFragment), GalleryImageReferenceFragment galleryImageReference = default(GalleryImageReferenceFragment), ComputeVmPropertiesFragment computeVm = default(ComputeVmPropertiesFragment), NetworkInterfacePropertiesFragment networkInterface = default(NetworkInterfacePropertiesFragment), ApplicableScheduleFragment applicableSchedule = default(ApplicableScheduleFragment), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The notes of the virtual machine. + /// + + /// The object identifier of the owner of the virtual machine. + /// + + /// The user principal name of the virtual machine owner. + /// + + /// The object identifier of the creator of the virtual machine. + /// + + /// The email address of creator of the virtual machine. + /// + + /// The creation date of the virtual machine. + /// + + /// The custom image identifier of the virtual machine. + /// + + /// The OS type of the virtual machine. + /// + + /// The size of the virtual machine. + /// + + /// The user name of the virtual machine. + /// + + /// The password of the virtual machine administrator. + /// + + /// The SSH key of the virtual machine administrator. + /// + + /// Indicates whether this virtual machine uses an SSH key for authentication. + /// + + /// The fully-qualified domain name of the virtual machine. + /// + + /// The lab subnet name of the virtual machine. + /// + + /// The lab virtual network identifier of the virtual machine. + /// + + /// Indicates whether the virtual machine is to be created without a public IP + /// address. + /// + + /// The artifacts to be installed on the virtual machine. + /// + + /// The artifact deployment status for the virtual machine. + /// + + /// The Microsoft Azure Marketplace image reference of the virtual machine. + /// + + /// The compute virtual machine properties. + /// + + /// The network interface properties. + /// + + /// The applicable schedule for the virtual machine. + /// + + /// The expiration date for VM. + /// + + /// Indicates whether another user can take ownership of the virtual machine + /// + + /// Storage type to use for virtual machine (i.e. Standard, Premium). + /// + + /// Tells source of creation of lab virtual machine. Output property only. + /// Possible values include: 'FromCustomImage', 'FromGalleryImage' + + /// The resource ID of the environment that contains this virtual machine, if + /// any. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabVirtualMachineFragment(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), string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIPAddress = default(bool?), System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList), ArtifactDeploymentStatusPropertiesFragment artifactDeploymentStatus = default(ArtifactDeploymentStatusPropertiesFragment), GalleryImageReferenceFragment galleryImageReference = default(GalleryImageReferenceFragment), ComputeVmPropertiesFragment computeVM = default(ComputeVmPropertiesFragment), NetworkInterfacePropertiesFragment networkInterface = default(NetworkInterfacePropertiesFragment), ApplicableScheduleFragment applicableSchedule = default(ApplicableScheduleFragment), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Notes = notes; - OwnerObjectId = ownerObjectId; - OwnerUserPrincipalName = ownerUserPrincipalName; - CreatedByUserId = createdByUserId; - CreatedByUser = createdByUser; - CreatedDate = createdDate; - CustomImageId = customImageId; - OsType = osType; - Size = size; - UserName = userName; - Password = password; - SshKey = sshKey; - IsAuthenticationWithSshKey = isAuthenticationWithSshKey; - Fqdn = fqdn; - LabSubnetName = labSubnetName; - LabVirtualNetworkId = labVirtualNetworkId; - DisallowPublicIpAddress = disallowPublicIpAddress; - Artifacts = artifacts; - ArtifactDeploymentStatus = artifactDeploymentStatus; - GalleryImageReference = galleryImageReference; - ComputeVm = computeVm; - NetworkInterface = networkInterface; - ApplicableSchedule = applicableSchedule; - ExpirationDate = expirationDate; - AllowClaim = allowClaim; - StorageType = storageType; - VirtualMachineCreationSource = virtualMachineCreationSource; - EnvironmentId = environmentId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Notes = notes; + this.OwnerObjectId = ownerObjectId; + this.OwnerUserPrincipalName = ownerUserPrincipalName; + this.CreatedByUserId = createdByUserId; + this.CreatedByUser = createdByUser; + this.CreatedDate = createdDate; + this.CustomImageId = customImageId; + this.OSType = osType; + this.Size = size; + this.UserName = userName; + this.Password = password; + this.SshKey = sshKey; + this.IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + this.Fqdn = fqdn; + this.LabSubnetName = labSubnetName; + this.LabVirtualNetworkId = labVirtualNetworkId; + this.DisallowPublicIPAddress = disallowPublicIPAddress; + this.Artifacts = artifacts; + this.ArtifactDeploymentStatus = artifactDeploymentStatus; + this.GalleryImageReference = galleryImageReference; + this.ComputeVM = computeVM; + this.NetworkInterface = networkInterface; + this.ApplicableSchedule = applicableSchedule; + this.ExpirationDate = expirationDate; + this.AllowClaim = allowClaim; + this.StorageType = storageType; + this.VirtualMachineCreationSource = virtualMachineCreationSource; + this.EnvironmentId = environmentId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -137,198 +173,192 @@ public LabVirtualMachineFragment() /// partial void CustomInit(); + /// /// Gets or sets the notes of the virtual machine. /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notes")] + public string Notes {get; set; } /// - /// Gets or sets the object identifier of the owner of the virtual - /// machine. + /// Gets or sets the object identifier of the owner of the virtual machine. /// - [JsonProperty(PropertyName = "properties.ownerObjectId")] - public string OwnerObjectId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ownerObjectId")] + public string OwnerObjectId {get; set; } /// /// Gets or sets the user principal name of the virtual machine owner. /// - [JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] - public string OwnerUserPrincipalName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ownerUserPrincipalName")] + public string OwnerUserPrincipalName {get; set; } /// - /// Gets or sets the object identifier of the creator of the virtual - /// machine. + /// Gets or sets the object identifier of the creator of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdByUserId")] - public string CreatedByUserId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUserId")] + public string CreatedByUserId {get; set; } /// /// Gets or sets the email address of creator of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdByUser")] - public string CreatedByUser { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdByUser")] + public string CreatedByUser {get; set; } /// /// Gets or sets the creation date of the virtual machine. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; set; } /// /// Gets or sets the custom image identifier of the virtual machine. /// - [JsonProperty(PropertyName = "properties.customImageId")] - public string CustomImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customImageId")] + public string CustomImageId {get; set; } /// /// Gets or sets the OS type of the virtual machine. /// - [JsonProperty(PropertyName = "properties.osType")] - public string OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public string OSType {get; set; } /// /// Gets or sets the size of the virtual machine. /// - [JsonProperty(PropertyName = "properties.size")] - public string Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public string Size {get; set; } /// /// Gets or sets the user name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.userName")] + public string UserName {get; set; } /// /// Gets or sets the password of the virtual machine administrator. /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.password")] + public string Password {get; set; } /// /// Gets or sets the SSH key of the virtual machine administrator. /// - [JsonProperty(PropertyName = "properties.sshKey")] - public string SshKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sshKey")] + public string SshKey {get; set; } /// - /// Gets or sets indicates whether this virtual machine uses an SSH key - /// for authentication. + /// Gets or sets indicates whether this virtual machine uses an SSH key for + /// authentication. /// - [JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] - public bool? IsAuthenticationWithSshKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey {get; set; } /// - /// Gets or sets the fully-qualified domain name of the virtual - /// machine. + /// Gets or sets the fully-qualified domain name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.fqdn")] - public string Fqdn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fqdn")] + public string Fqdn {get; set; } /// /// Gets or sets the lab subnet name of the virtual machine. /// - [JsonProperty(PropertyName = "properties.labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets the lab virtual network identifier of the virtual - /// machine. + /// Gets or sets the lab virtual network identifier of the virtual machine. /// - [JsonProperty(PropertyName = "properties.labVirtualNetworkId")] - public string LabVirtualNetworkId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.labVirtualNetworkId")] + public string LabVirtualNetworkId {get; set; } /// - /// Gets or sets indicates whether the virtual machine is to be created - /// without a public IP address. + /// Gets or sets indicates whether the virtual machine is to be created without + /// a public IP address. /// - [JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] - public bool? DisallowPublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowPublicIpAddress")] + public bool? DisallowPublicIPAddress {get; set; } /// /// Gets or sets the artifacts to be installed on the virtual machine. /// - [JsonProperty(PropertyName = "properties.artifacts")] - public IList Artifacts { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } /// - /// Gets or sets the artifact deployment status for the virtual - /// machine. + /// Gets or sets the artifact deployment status for the virtual machine. /// - [JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] - public ArtifactDeploymentStatusPropertiesFragment ArtifactDeploymentStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactDeploymentStatus")] + public ArtifactDeploymentStatusPropertiesFragment ArtifactDeploymentStatus {get; set; } /// - /// Gets or sets the Microsoft Azure Marketplace image reference of the - /// virtual machine. + /// Gets or sets the Microsoft Azure Marketplace image reference of the virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.galleryImageReference")] - public GalleryImageReferenceFragment GalleryImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.galleryImageReference")] + public GalleryImageReferenceFragment GalleryImageReference {get; set; } /// /// Gets or sets the compute virtual machine properties. /// - [JsonProperty(PropertyName = "properties.computeVm")] - public ComputeVmPropertiesFragment ComputeVm { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.computeVm")] + public ComputeVmPropertiesFragment ComputeVM {get; set; } /// /// Gets or sets the network interface properties. /// - [JsonProperty(PropertyName = "properties.networkInterface")] - public NetworkInterfacePropertiesFragment NetworkInterface { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkInterface")] + public NetworkInterfacePropertiesFragment NetworkInterface {get; set; } /// /// Gets or sets the applicable schedule for the virtual machine. /// - [JsonProperty(PropertyName = "properties.applicableSchedule")] - public ApplicableScheduleFragment ApplicableSchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicableSchedule")] + public ApplicableScheduleFragment ApplicableSchedule {get; set; } /// /// Gets or sets the expiration date for VM. /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.expirationDate")] + public System.DateTime? ExpirationDate {get; set; } /// - /// Gets or sets indicates whether another user can take ownership of - /// the virtual machine + /// Gets or sets indicates whether another user can take ownership of the + /// virtual machine /// - [JsonProperty(PropertyName = "properties.allowClaim")] - public bool? AllowClaim { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowClaim")] + public bool? AllowClaim {get; set; } /// - /// Gets or sets storage type to use for virtual machine (i.e. - /// Standard, Premium). + /// Gets or sets storage type to use for virtual machine (i.e. Standard, + /// Premium). /// - [JsonProperty(PropertyName = "properties.storageType")] - public string StorageType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageType")] + public string StorageType {get; set; } /// - /// Gets or sets tells source of creation of lab virtual machine. - /// Output property only. Possible values include: 'FromCustomImage', - /// 'FromGalleryImage' + /// Gets or sets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' /// - [JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] - public string VirtualMachineCreationSource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineCreationSource")] + public string VirtualMachineCreationSource {get; set; } /// - /// Gets or sets the resource ID of the environment that contains this - /// virtual machine, if any. + /// Gets or sets the resource ID of the environment that contains this virtual + /// machine, if any. /// - [JsonProperty(PropertyName = "properties.environmentId")] - public string EnvironmentId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.environmentId")] + public string EnvironmentId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineProperties.cs new file mode 100644 index 000000000000..98af8448e611 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineProperties.cs @@ -0,0 +1,357 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a virtual machine. + /// + public partial class LabVirtualMachineProperties + { + /// + /// Initializes a new instance of the LabVirtualMachineProperties class. + /// + public LabVirtualMachineProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabVirtualMachineProperties class. + /// + + /// The notes of the virtual machine. + /// + + /// The object identifier of the owner of the virtual machine. + /// + + /// The user principal name of the virtual machine owner. + /// + + /// The object identifier of the creator of the virtual machine. + /// + + /// The email address of creator of the virtual machine. + /// + + /// The creation date of the virtual machine. + /// + + /// The resource identifier (Microsoft.Compute) of the virtual machine. + /// + + /// The custom image identifier of the virtual machine. + /// + + /// The OS type of the virtual machine. + /// + + /// The size of the virtual machine. + /// + + /// The user name of the virtual machine. + /// + + /// The password of the virtual machine administrator. + /// + + /// The SSH key of the virtual machine administrator. + /// + + /// Indicates whether this virtual machine uses an SSH key for authentication. + /// + + /// The fully-qualified domain name of the virtual machine. + /// + + /// The lab subnet name of the virtual machine. + /// + + /// The lab virtual network identifier of the virtual machine. + /// + + /// Indicates whether the virtual machine is to be created without a public IP + /// address. + /// + + /// The artifacts to be installed on the virtual machine. + /// + + /// The artifact deployment status for the virtual machine. + /// + + /// The Microsoft Azure Marketplace image reference of the virtual machine. + /// + + /// The compute virtual machine properties. + /// + + /// The network interface properties. + /// + + /// The applicable schedule for the virtual machine. + /// + + /// The expiration date for VM. + /// + + /// Indicates whether another user can take ownership of the virtual machine + /// + + /// Storage type to use for virtual machine (i.e. Standard, Premium). + /// + + /// Tells source of creation of lab virtual machine. Output property only. + /// Possible values include: 'FromCustomImage', 'FromGalleryImage' + + /// The resource ID of the environment that contains this virtual machine, if + /// any. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabVirtualMachineProperties(string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string computeId = default(string), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIPAddress = default(bool?), System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList), ArtifactDeploymentStatusProperties artifactDeploymentStatus = default(ArtifactDeploymentStatusProperties), GalleryImageReference galleryImageReference = default(GalleryImageReference), ComputeVmProperties computeVM = default(ComputeVmProperties), NetworkInterfaceProperties networkInterface = default(NetworkInterfaceProperties), ApplicableSchedule applicableSchedule = default(ApplicableSchedule), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Notes = notes; + this.OwnerObjectId = ownerObjectId; + this.OwnerUserPrincipalName = ownerUserPrincipalName; + this.CreatedByUserId = createdByUserId; + this.CreatedByUser = createdByUser; + this.CreatedDate = createdDate; + this.ComputeId = computeId; + this.CustomImageId = customImageId; + this.OSType = osType; + this.Size = size; + this.UserName = userName; + this.Password = password; + this.SshKey = sshKey; + this.IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + this.Fqdn = fqdn; + this.LabSubnetName = labSubnetName; + this.LabVirtualNetworkId = labVirtualNetworkId; + this.DisallowPublicIPAddress = disallowPublicIPAddress; + this.Artifacts = artifacts; + this.ArtifactDeploymentStatus = artifactDeploymentStatus; + this.GalleryImageReference = galleryImageReference; + this.ComputeVM = computeVM; + this.NetworkInterface = networkInterface; + this.ApplicableSchedule = applicableSchedule; + this.ExpirationDate = expirationDate; + this.AllowClaim = allowClaim; + this.StorageType = storageType; + this.VirtualMachineCreationSource = virtualMachineCreationSource; + this.EnvironmentId = environmentId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the notes of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notes")] + public string Notes {get; set; } + + /// + /// Gets or sets the object identifier of the owner of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerObjectId")] + public string OwnerObjectId {get; set; } + + /// + /// Gets or sets the user principal name of the virtual machine owner. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerUserPrincipalName")] + public string OwnerUserPrincipalName {get; set; } + + /// + /// Gets or sets the object identifier of the creator of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUserId")] + public string CreatedByUserId {get; set; } + + /// + /// Gets or sets the email address of creator of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUser")] + public string CreatedByUser {get; set; } + + /// + /// Gets or sets the creation date of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; set; } + + /// + /// Gets the resource identifier (Microsoft.Compute) of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "computeId")] + public string ComputeId {get; private set; } + + /// + /// Gets or sets the custom image identifier of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customImageId")] + public string CustomImageId {get; set; } + + /// + /// Gets or sets the OS type of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } + + /// + /// Gets or sets the size of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; set; } + + /// + /// Gets or sets the user name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userName")] + public string UserName {get; set; } + + /// + /// Gets or sets the password of the virtual machine administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + public string Password {get; set; } + + /// + /// Gets or sets the SSH key of the virtual machine administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sshKey")] + public string SshKey {get; set; } + + /// + /// Gets or sets indicates whether this virtual machine uses an SSH key for + /// authentication. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey {get; set; } + + /// + /// Gets or sets the fully-qualified domain name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } + + /// + /// Gets or sets the lab subnet name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } + + /// + /// Gets or sets the lab virtual network identifier of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVirtualNetworkId")] + public string LabVirtualNetworkId {get; set; } + + /// + /// Gets or sets indicates whether the virtual machine is to be created without + /// a public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowPublicIpAddress")] + public bool? DisallowPublicIPAddress {get; set; } + + /// + /// Gets or sets the artifacts to be installed on the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } + + /// + /// Gets or sets the artifact deployment status for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactDeploymentStatus")] + public ArtifactDeploymentStatusProperties ArtifactDeploymentStatus {get; set; } + + /// + /// Gets or sets the Microsoft Azure Marketplace image reference of the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "galleryImageReference")] + public GalleryImageReference GalleryImageReference {get; set; } + + /// + /// Gets or sets the compute virtual machine properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "computeVm")] + public ComputeVmProperties ComputeVM {get; set; } + + /// + /// Gets or sets the network interface properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterface")] + public NetworkInterfaceProperties NetworkInterface {get; set; } + + /// + /// Gets or sets the applicable schedule for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicableSchedule")] + public ApplicableSchedule ApplicableSchedule {get; set; } + + /// + /// Gets or sets the expiration date for VM. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expirationDate")] + public System.DateTime? ExpirationDate {get; set; } + + /// + /// Gets or sets indicates whether another user can take ownership of the + /// virtual machine + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowClaim")] + public bool? AllowClaim {get; set; } + + /// + /// Gets or sets storage type to use for virtual machine (i.e. Standard, + /// Premium). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageType")] + public string StorageType {get; set; } + + /// + /// Gets or sets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineCreationSource")] + public string VirtualMachineCreationSource {get; set; } + + /// + /// Gets or sets the resource ID of the environment that contains this virtual + /// machine, if any. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "environmentId")] + public string EnvironmentId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachinePropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachinePropertiesFragment.cs new file mode 100644 index 000000000000..356465ca92c8 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachinePropertiesFragment.cs @@ -0,0 +1,347 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a virtual machine. + /// + public partial class LabVirtualMachinePropertiesFragment + { + /// + /// Initializes a new instance of the LabVirtualMachinePropertiesFragment class. + /// + public LabVirtualMachinePropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LabVirtualMachinePropertiesFragment class. + /// + + /// The notes of the virtual machine. + /// + + /// The object identifier of the owner of the virtual machine. + /// + + /// The user principal name of the virtual machine owner. + /// + + /// The object identifier of the creator of the virtual machine. + /// + + /// The email address of creator of the virtual machine. + /// + + /// The creation date of the virtual machine. + /// + + /// The custom image identifier of the virtual machine. + /// + + /// The OS type of the virtual machine. + /// + + /// The size of the virtual machine. + /// + + /// The user name of the virtual machine. + /// + + /// The password of the virtual machine administrator. + /// + + /// The SSH key of the virtual machine administrator. + /// + + /// Indicates whether this virtual machine uses an SSH key for authentication. + /// + + /// The fully-qualified domain name of the virtual machine. + /// + + /// The lab subnet name of the virtual machine. + /// + + /// The lab virtual network identifier of the virtual machine. + /// + + /// Indicates whether the virtual machine is to be created without a public IP + /// address. + /// + + /// The artifacts to be installed on the virtual machine. + /// + + /// The artifact deployment status for the virtual machine. + /// + + /// The Microsoft Azure Marketplace image reference of the virtual machine. + /// + + /// The compute virtual machine properties. + /// + + /// The network interface properties. + /// + + /// The applicable schedule for the virtual machine. + /// + + /// The expiration date for VM. + /// + + /// Indicates whether another user can take ownership of the virtual machine + /// + + /// Storage type to use for virtual machine (i.e. Standard, Premium). + /// + + /// Tells source of creation of lab virtual machine. Output property only. + /// Possible values include: 'FromCustomImage', 'FromGalleryImage' + + /// The resource ID of the environment that contains this virtual machine, if + /// any. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public LabVirtualMachinePropertiesFragment(string notes = default(string), string ownerObjectId = default(string), string ownerUserPrincipalName = default(string), string createdByUserId = default(string), string createdByUser = default(string), System.DateTime? createdDate = default(System.DateTime?), string customImageId = default(string), string osType = default(string), string size = default(string), string userName = default(string), string password = default(string), string sshKey = default(string), bool? isAuthenticationWithSshKey = default(bool?), string fqdn = default(string), string labSubnetName = default(string), string labVirtualNetworkId = default(string), bool? disallowPublicIPAddress = default(bool?), System.Collections.Generic.IList artifacts = default(System.Collections.Generic.IList), ArtifactDeploymentStatusPropertiesFragment artifactDeploymentStatus = default(ArtifactDeploymentStatusPropertiesFragment), GalleryImageReferenceFragment galleryImageReference = default(GalleryImageReferenceFragment), ComputeVmPropertiesFragment computeVM = default(ComputeVmPropertiesFragment), NetworkInterfacePropertiesFragment networkInterface = default(NetworkInterfacePropertiesFragment), ApplicableScheduleFragment applicableSchedule = default(ApplicableScheduleFragment), System.DateTime? expirationDate = default(System.DateTime?), bool? allowClaim = default(bool?), string storageType = default(string), string virtualMachineCreationSource = default(string), string environmentId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Notes = notes; + this.OwnerObjectId = ownerObjectId; + this.OwnerUserPrincipalName = ownerUserPrincipalName; + this.CreatedByUserId = createdByUserId; + this.CreatedByUser = createdByUser; + this.CreatedDate = createdDate; + this.CustomImageId = customImageId; + this.OSType = osType; + this.Size = size; + this.UserName = userName; + this.Password = password; + this.SshKey = sshKey; + this.IsAuthenticationWithSshKey = isAuthenticationWithSshKey; + this.Fqdn = fqdn; + this.LabSubnetName = labSubnetName; + this.LabVirtualNetworkId = labVirtualNetworkId; + this.DisallowPublicIPAddress = disallowPublicIPAddress; + this.Artifacts = artifacts; + this.ArtifactDeploymentStatus = artifactDeploymentStatus; + this.GalleryImageReference = galleryImageReference; + this.ComputeVM = computeVM; + this.NetworkInterface = networkInterface; + this.ApplicableSchedule = applicableSchedule; + this.ExpirationDate = expirationDate; + this.AllowClaim = allowClaim; + this.StorageType = storageType; + this.VirtualMachineCreationSource = virtualMachineCreationSource; + this.EnvironmentId = environmentId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the notes of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notes")] + public string Notes {get; set; } + + /// + /// Gets or sets the object identifier of the owner of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerObjectId")] + public string OwnerObjectId {get; set; } + + /// + /// Gets or sets the user principal name of the virtual machine owner. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerUserPrincipalName")] + public string OwnerUserPrincipalName {get; set; } + + /// + /// Gets or sets the object identifier of the creator of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUserId")] + public string CreatedByUserId {get; set; } + + /// + /// Gets or sets the email address of creator of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByUser")] + public string CreatedByUser {get; set; } + + /// + /// Gets or sets the creation date of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; set; } + + /// + /// Gets or sets the custom image identifier of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customImageId")] + public string CustomImageId {get; set; } + + /// + /// Gets or sets the OS type of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OSType {get; set; } + + /// + /// Gets or sets the size of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; set; } + + /// + /// Gets or sets the user name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userName")] + public string UserName {get; set; } + + /// + /// Gets or sets the password of the virtual machine administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + public string Password {get; set; } + + /// + /// Gets or sets the SSH key of the virtual machine administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sshKey")] + public string SshKey {get; set; } + + /// + /// Gets or sets indicates whether this virtual machine uses an SSH key for + /// authentication. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isAuthenticationWithSshKey")] + public bool? IsAuthenticationWithSshKey {get; set; } + + /// + /// Gets or sets the fully-qualified domain name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fqdn")] + public string Fqdn {get; set; } + + /// + /// Gets or sets the lab subnet name of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } + + /// + /// Gets or sets the lab virtual network identifier of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "labVirtualNetworkId")] + public string LabVirtualNetworkId {get; set; } + + /// + /// Gets or sets indicates whether the virtual machine is to be created without + /// a public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowPublicIpAddress")] + public bool? DisallowPublicIPAddress {get; set; } + + /// + /// Gets or sets the artifacts to be installed on the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifacts")] + public System.Collections.Generic.IList Artifacts {get; set; } + + /// + /// Gets or sets the artifact deployment status for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactDeploymentStatus")] + public ArtifactDeploymentStatusPropertiesFragment ArtifactDeploymentStatus {get; set; } + + /// + /// Gets or sets the Microsoft Azure Marketplace image reference of the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "galleryImageReference")] + public GalleryImageReferenceFragment GalleryImageReference {get; set; } + + /// + /// Gets or sets the compute virtual machine properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "computeVm")] + public ComputeVmPropertiesFragment ComputeVM {get; set; } + + /// + /// Gets or sets the network interface properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterface")] + public NetworkInterfacePropertiesFragment NetworkInterface {get; set; } + + /// + /// Gets or sets the applicable schedule for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicableSchedule")] + public ApplicableScheduleFragment ApplicableSchedule {get; set; } + + /// + /// Gets or sets the expiration date for VM. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expirationDate")] + public System.DateTime? ExpirationDate {get; set; } + + /// + /// Gets or sets indicates whether another user can take ownership of the + /// virtual machine + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowClaim")] + public bool? AllowClaim {get; set; } + + /// + /// Gets or sets storage type to use for virtual machine (i.e. Standard, + /// Premium). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageType")] + public string StorageType {get; set; } + + /// + /// Gets or sets tells source of creation of lab virtual machine. Output + /// property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineCreationSource")] + public string VirtualMachineCreationSource {get; set; } + + /// + /// Gets or sets the resource ID of the environment that contains this virtual + /// machine, if any. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "environmentId")] + public string EnvironmentId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsInfo.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsInfo.cs index cdd1c1023010..3c5634f8c405 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsInfo.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsInfo.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,15 @@ public LinuxOsInfo() /// /// Initializes a new instance of the LinuxOsInfo class. /// - /// The state of the Linux OS (i.e. - /// NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). - /// Possible values include: 'NonDeprovisioned', - /// 'DeprovisionRequested', 'DeprovisionApplied' - public LinuxOsInfo(string linuxOsState = default(string)) + + /// The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + /// DeprovisionApplied). + /// Possible values include: 'NonDeprovisioned', 'DeprovisionRequested', + /// 'DeprovisionApplied' + public LinuxOsInfo(string linuxOSState = default(string)) + { - LinuxOsState = linuxOsState; + this.LinuxOSState = linuxOSState; CustomInit(); } @@ -44,13 +40,12 @@ public LinuxOsInfo() /// partial void CustomInit(); + /// /// Gets or sets the state of the Linux OS (i.e. NonDeprovisioned, - /// DeprovisionRequested, DeprovisionApplied). Possible values include: - /// 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' + /// DeprovisionRequested, DeprovisionApplied). Possible values include: 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' /// - [JsonProperty(PropertyName = "linuxOsState")] - public string LinuxOsState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linuxOsState")] + public string LinuxOSState {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsState.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsState.cs index 2c5212fbb8ab..35fad833c348 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsState.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsState.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.DevTestLabs.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for LinuxOsState. /// + + public static class LinuxOsState { public const string NonDeprovisioned = "NonDeprovisioned"; public const string DeprovisionRequested = "DeprovisionRequested"; public const string DeprovisionApplied = "DeprovisionApplied"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfaceProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfaceProperties.cs index af26330b86bd..59d8c15b832a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfaceProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfaceProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,34 +23,48 @@ public NetworkInterfaceProperties() /// /// Initializes a new instance of the NetworkInterfaceProperties class. /// - /// The resource ID of the virtual - /// network. - /// The resource ID of the sub net. - /// The resource ID of the public IP - /// address. - /// The public IP address. - /// The private IP address. - /// The DNS name. - /// The RdpAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// RDP (Remote Desktop Protocol). - /// The SshAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// SSH. - /// The configuration - /// for sharing a public IP address across multiple virtual - /// machines. - public NetworkInterfaceProperties(string virtualNetworkId = default(string), string subnetId = default(string), string publicIpAddressId = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), SharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration = default(SharedPublicIpAddressConfiguration)) + + /// The resource ID of the virtual network. + /// + + /// The resource ID of the sub net. + /// + + /// The resource ID of the public IP address. + /// + + /// The public IP address. + /// + + /// The private IP address. + /// + + /// The DNS name. + /// + + /// The RdpAuthority property is a server DNS host name or IP address followed + /// by the service port number for RDP (Remote Desktop Protocol). + /// + + /// The SshAuthority property is a server DNS host name or IP address followed + /// by the service port number for SSH. + /// + + /// The configuration for sharing a public IP address across multiple virtual + /// machines. + /// + public NetworkInterfaceProperties(string virtualNetworkId = default(string), string subnetId = default(string), string publicIPAddressId = default(string), string publicIPAddress = default(string), string privateIPAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), SharedPublicIpAddressConfiguration sharedPublicIPAddressConfiguration = default(SharedPublicIpAddressConfiguration)) + { - VirtualNetworkId = virtualNetworkId; - SubnetId = subnetId; - PublicIpAddressId = publicIpAddressId; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; - DnsName = dnsName; - RdpAuthority = rdpAuthority; - SshAuthority = sshAuthority; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; + this.VirtualNetworkId = virtualNetworkId; + this.SubnetId = subnetId; + this.PublicIPAddressId = publicIPAddressId; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; + this.DnsName = dnsName; + this.RdpAuthority = rdpAuthority; + this.SshAuthority = sshAuthority; + this.SharedPublicIPAddressConfiguration = sharedPublicIPAddressConfiguration; CustomInit(); } @@ -65,63 +73,63 @@ public NetworkInterfaceProperties() /// partial void CustomInit(); + /// /// Gets or sets the resource ID of the virtual network. /// - [JsonProperty(PropertyName = "virtualNetworkId")] - public string VirtualNetworkId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkId")] + public string VirtualNetworkId {get; set; } /// /// Gets or sets the resource ID of the sub net. /// - [JsonProperty(PropertyName = "subnetId")] - public string SubnetId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetId")] + public string SubnetId {get; set; } /// /// Gets or sets the resource ID of the public IP address. /// - [JsonProperty(PropertyName = "publicIpAddressId")] - public string PublicIpAddressId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddressId")] + public string PublicIPAddressId {get; set; } /// /// Gets or sets the public IP address. /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIPAddress {get; set; } /// /// Gets or sets the private IP address. /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIPAddress {get; set; } /// /// Gets or sets the DNS name. /// - [JsonProperty(PropertyName = "dnsName")] - public string DnsName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsName")] + public string DnsName {get; set; } /// - /// Gets or sets the RdpAuthority property is a server DNS host name or - /// IP address followed by the service port number for RDP (Remote - /// Desktop Protocol). + /// Gets or sets the RdpAuthority property is a server DNS host name or IP + /// address followed by the service port number for RDP (Remote Desktop + /// Protocol). /// - [JsonProperty(PropertyName = "rdpAuthority")] - public string RdpAuthority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rdpAuthority")] + public string RdpAuthority {get; set; } /// - /// Gets or sets the SshAuthority property is a server DNS host name or - /// IP address followed by the service port number for SSH. + /// Gets or sets the SshAuthority property is a server DNS host name or IP + /// address followed by the service port number for SSH. /// - [JsonProperty(PropertyName = "sshAuthority")] - public string SshAuthority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sshAuthority")] + public string SshAuthority {get; set; } /// - /// Gets or sets the configuration for sharing a public IP address - /// across multiple virtual machines. + /// Gets or sets the configuration for sharing a public IP address across + /// multiple virtual machines. /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SharedPublicIpAddressConfiguration SharedPublicIpAddressConfiguration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] + public SharedPublicIpAddressConfiguration SharedPublicIPAddressConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFragment.cs index e790d77f8f65..4bfdb7a76adc 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class NetworkInterfacePropertiesFragment { /// - /// Initializes a new instance of the - /// NetworkInterfacePropertiesFragment class. + /// Initializes a new instance of the NetworkInterfacePropertiesFragment class. /// public NetworkInterfacePropertiesFragment() { @@ -28,37 +21,50 @@ public NetworkInterfacePropertiesFragment() } /// - /// Initializes a new instance of the - /// NetworkInterfacePropertiesFragment class. + /// Initializes a new instance of the NetworkInterfacePropertiesFragment class. /// - /// The resource ID of the virtual - /// network. - /// The resource ID of the sub net. - /// The resource ID of the public IP - /// address. - /// The public IP address. - /// The private IP address. - /// The DNS name. - /// The RdpAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// RDP (Remote Desktop Protocol). - /// The SshAuthority property is a server - /// DNS host name or IP address followed by the service port number for - /// SSH. - /// The configuration - /// for sharing a public IP address across multiple virtual - /// machines. - public NetworkInterfacePropertiesFragment(string virtualNetworkId = default(string), string subnetId = default(string), string publicIpAddressId = default(string), string publicIpAddress = default(string), string privateIpAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), SharedPublicIpAddressConfigurationFragment sharedPublicIpAddressConfiguration = default(SharedPublicIpAddressConfigurationFragment)) + + /// The resource ID of the virtual network. + /// + + /// The resource ID of the sub net. + /// + + /// The resource ID of the public IP address. + /// + + /// The public IP address. + /// + + /// The private IP address. + /// + + /// The DNS name. + /// + + /// The RdpAuthority property is a server DNS host name or IP address followed + /// by the service port number for RDP (Remote Desktop Protocol). + /// + + /// The SshAuthority property is a server DNS host name or IP address followed + /// by the service port number for SSH. + /// + + /// The configuration for sharing a public IP address across multiple virtual + /// machines. + /// + public NetworkInterfacePropertiesFragment(string virtualNetworkId = default(string), string subnetId = default(string), string publicIPAddressId = default(string), string publicIPAddress = default(string), string privateIPAddress = default(string), string dnsName = default(string), string rdpAuthority = default(string), string sshAuthority = default(string), SharedPublicIpAddressConfigurationFragment sharedPublicIPAddressConfiguration = default(SharedPublicIpAddressConfigurationFragment)) + { - VirtualNetworkId = virtualNetworkId; - SubnetId = subnetId; - PublicIpAddressId = publicIpAddressId; - PublicIpAddress = publicIpAddress; - PrivateIpAddress = privateIpAddress; - DnsName = dnsName; - RdpAuthority = rdpAuthority; - SshAuthority = sshAuthority; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; + this.VirtualNetworkId = virtualNetworkId; + this.SubnetId = subnetId; + this.PublicIPAddressId = publicIPAddressId; + this.PublicIPAddress = publicIPAddress; + this.PrivateIPAddress = privateIPAddress; + this.DnsName = dnsName; + this.RdpAuthority = rdpAuthority; + this.SshAuthority = sshAuthority; + this.SharedPublicIPAddressConfiguration = sharedPublicIPAddressConfiguration; CustomInit(); } @@ -67,63 +73,63 @@ public NetworkInterfacePropertiesFragment() /// partial void CustomInit(); + /// /// Gets or sets the resource ID of the virtual network. /// - [JsonProperty(PropertyName = "virtualNetworkId")] - public string VirtualNetworkId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkId")] + public string VirtualNetworkId {get; set; } /// /// Gets or sets the resource ID of the sub net. /// - [JsonProperty(PropertyName = "subnetId")] - public string SubnetId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetId")] + public string SubnetId {get; set; } /// /// Gets or sets the resource ID of the public IP address. /// - [JsonProperty(PropertyName = "publicIpAddressId")] - public string PublicIpAddressId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddressId")] + public string PublicIPAddressId {get; set; } /// /// Gets or sets the public IP address. /// - [JsonProperty(PropertyName = "publicIpAddress")] - public string PublicIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIpAddress")] + public string PublicIPAddress {get; set; } /// /// Gets or sets the private IP address. /// - [JsonProperty(PropertyName = "privateIpAddress")] - public string PrivateIpAddress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIpAddress")] + public string PrivateIPAddress {get; set; } /// /// Gets or sets the DNS name. /// - [JsonProperty(PropertyName = "dnsName")] - public string DnsName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsName")] + public string DnsName {get; set; } /// - /// Gets or sets the RdpAuthority property is a server DNS host name or - /// IP address followed by the service port number for RDP (Remote - /// Desktop Protocol). + /// Gets or sets the RdpAuthority property is a server DNS host name or IP + /// address followed by the service port number for RDP (Remote Desktop + /// Protocol). /// - [JsonProperty(PropertyName = "rdpAuthority")] - public string RdpAuthority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rdpAuthority")] + public string RdpAuthority {get; set; } /// - /// Gets or sets the SshAuthority property is a server DNS host name or - /// IP address followed by the service port number for SSH. + /// Gets or sets the SshAuthority property is a server DNS host name or IP + /// address followed by the service port number for SSH. /// - [JsonProperty(PropertyName = "sshAuthority")] - public string SshAuthority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sshAuthority")] + public string SshAuthority {get; set; } /// - /// Gets or sets the configuration for sharing a public IP address - /// across multiple virtual machines. + /// Gets or sets the configuration for sharing a public IP address across + /// multiple virtual machines. /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SharedPublicIpAddressConfigurationFragment SharedPublicIpAddressConfiguration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] + public SharedPublicIpAddressConfigurationFragment SharedPublicIPAddressConfiguration {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannel.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannel.cs index 17ac4b8e5798..0b21883bf506 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannel.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannel.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A notification. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NotificationChannel : Resource { /// @@ -34,31 +24,49 @@ public NotificationChannel() /// /// Initializes a new instance of the NotificationChannel class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The webhook URL to send notifications - /// to. - /// Description of notification. - /// The list of event for which this notification - /// is enabled. - /// The creation date of the notification - /// channel. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public NotificationChannel(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string webHookUrl = default(string), string description = default(string), IList events = default(IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The webhook URL to send notifications to. + /// + + /// Description of notification. + /// + + /// The list of event for which this notification is enabled. + /// + + /// The creation date of the notification channel. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public NotificationChannel(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), string webHookUrl = default(string), string description = default(string), System.Collections.Generic.IList events = default(System.Collections.Generic.IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - WebHookUrl = webHookUrl; - Description = description; - Events = events; - CreatedDate = createdDate; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.WebHookUrl = webHookUrl; + this.Description = description; + this.Events = events; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -67,42 +75,41 @@ public NotificationChannel() /// partial void CustomInit(); + /// /// Gets or sets the webhook URL to send notifications to. /// - [JsonProperty(PropertyName = "properties.webHookUrl")] - public string WebHookUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.webHookUrl")] + public string WebHookUrl {get; set; } /// /// Gets or sets description of notification. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the list of event for which this notification is - /// enabled. + /// Gets or sets the list of event for which this notification is enabled. /// - [JsonProperty(PropertyName = "properties.events")] - public IList Events { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.events")] + public System.Collections.Generic.IList Events {get; set; } /// /// Gets the creation date of the notification channel. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelEventType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelEventType.cs index abe6a61224b5..bbd575f13ab4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelEventType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelEventType.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for NotificationChannelEventType. /// + + public static class NotificationChannelEventType { public const string AutoShutdown = "AutoShutdown"; public const string Cost = "Cost"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelFragment.cs index 2e9cc702278c..a49b7e4fbc66 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A notification. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NotificationChannelFragment : Resource { /// - /// Initializes a new instance of the NotificationChannelFragment - /// class. + /// Initializes a new instance of the NotificationChannelFragment class. /// public NotificationChannelFragment() { @@ -33,31 +22,47 @@ public NotificationChannelFragment() } /// - /// Initializes a new instance of the NotificationChannelFragment - /// class. + /// Initializes a new instance of the NotificationChannelFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The webhook URL to send notifications - /// to. - /// Description of notification. - /// The list of event for which this notification - /// is enabled. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public NotificationChannelFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string webHookUrl = default(string), string description = default(string), IList events = default(IList), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The webhook URL to send notifications to. + /// + + /// Description of notification. + /// + + /// The list of event for which this notification is enabled. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public NotificationChannelFragment(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), string webHookUrl = default(string), string description = default(string), System.Collections.Generic.IList events = default(System.Collections.Generic.IList), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - WebHookUrl = webHookUrl; - Description = description; - Events = events; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.WebHookUrl = webHookUrl; + this.Description = description; + this.Events = events; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -66,36 +71,35 @@ public NotificationChannelFragment() /// partial void CustomInit(); + /// /// Gets or sets the webhook URL to send notifications to. /// - [JsonProperty(PropertyName = "properties.webHookUrl")] - public string WebHookUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.webHookUrl")] + public string WebHookUrl {get; set; } /// /// Gets or sets description of notification. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the list of event for which this notification is - /// enabled. + /// Gets or sets the list of event for which this notification is enabled. /// - [JsonProperty(PropertyName = "properties.events")] - public IList Events { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.events")] + public System.Collections.Generic.IList Events {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelProperties.cs new file mode 100644 index 000000000000..bf1b0b85c3d9 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelProperties.cs @@ -0,0 +1,98 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a schedule. + /// + public partial class NotificationChannelProperties + { + /// + /// Initializes a new instance of the NotificationChannelProperties class. + /// + public NotificationChannelProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotificationChannelProperties class. + /// + + /// The webhook URL to send notifications to. + /// + + /// Description of notification. + /// + + /// The list of event for which this notification is enabled. + /// + + /// The creation date of the notification channel. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public NotificationChannelProperties(string webHookUrl = default(string), string description = default(string), System.Collections.Generic.IList events = default(System.Collections.Generic.IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.WebHookUrl = webHookUrl; + this.Description = description; + this.Events = events; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the webhook URL to send notifications to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "webHookUrl")] + public string WebHookUrl {get; set; } + + /// + /// Gets or sets description of notification. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the list of event for which this notification is enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "events")] + public System.Collections.Generic.IList Events {get; set; } + + /// + /// Gets the creation date of the notification channel. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelPropertiesFragment.cs new file mode 100644 index 000000000000..dc51ec48b22a --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelPropertiesFragment.cs @@ -0,0 +1,88 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a schedule. + /// + public partial class NotificationChannelPropertiesFragment + { + /// + /// Initializes a new instance of the NotificationChannelPropertiesFragment class. + /// + public NotificationChannelPropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotificationChannelPropertiesFragment class. + /// + + /// The webhook URL to send notifications to. + /// + + /// Description of notification. + /// + + /// The list of event for which this notification is enabled. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public NotificationChannelPropertiesFragment(string webHookUrl = default(string), string description = default(string), System.Collections.Generic.IList events = default(System.Collections.Generic.IList), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.WebHookUrl = webHookUrl; + this.Description = description; + this.Events = events; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the webhook URL to send notifications to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "webHookUrl")] + public string WebHookUrl {get; set; } + + /// + /// Gets or sets description of notification. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the list of event for which this notification is enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "events")] + public System.Collections.Generic.IList Events {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettings.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettings.cs index 0f278caec20e..e0fb24892023 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettings.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettings.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,21 @@ public NotificationSettings() /// /// Initializes a new instance of the NotificationSettings class. /// - /// If notifications are enabled for this schedule - /// (i.e. Enabled, Disabled). Possible values include: 'Disabled', - /// 'Enabled' - /// Time in minutes before event at which - /// notification will be sent. - /// The webhook URL to which the notification - /// will be sent. + + /// If notifications are enabled for this schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Disabled', 'Enabled' + + /// Time in minutes before event at which notification will be sent. + /// + + /// The webhook URL to which the notification will be sent. + /// public NotificationSettings(string status = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string)) + { - Status = status; - TimeInMinutes = timeInMinutes; - WebhookUrl = webhookUrl; + this.Status = status; + this.TimeInMinutes = timeInMinutes; + this.WebhookUrl = webhookUrl; CustomInit(); } @@ -49,26 +46,25 @@ public NotificationSettings() /// partial void CustomInit(); - /// - /// Gets or sets if notifications are enabled for this schedule (i.e. - /// Enabled, Disabled). Possible values include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } /// - /// Gets or sets time in minutes before event at which notification - /// will be sent. + /// Gets or sets if notifications are enabled for this schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "timeInMinutes")] - public int? TimeInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets the webhook URL to which the notification will be + /// Gets or sets time in minutes before event at which notification will be /// sent. /// - [JsonProperty(PropertyName = "webhookUrl")] - public string WebhookUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeInMinutes")] + public int? TimeInMinutes {get; set; } + /// + /// Gets or sets the webhook URL to which the notification will be sent. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "webhookUrl")] + public string WebhookUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettingsFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettingsFragment.cs index e99c931288ce..dbfff46f87ce 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettingsFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettingsFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class NotificationSettingsFragment { /// - /// Initializes a new instance of the NotificationSettingsFragment - /// class. + /// Initializes a new instance of the NotificationSettingsFragment class. /// public NotificationSettingsFragment() { @@ -28,21 +21,23 @@ public NotificationSettingsFragment() } /// - /// Initializes a new instance of the NotificationSettingsFragment - /// class. + /// Initializes a new instance of the NotificationSettingsFragment class. /// - /// If notifications are enabled for this schedule - /// (i.e. Enabled, Disabled). Possible values include: 'Disabled', - /// 'Enabled' - /// Time in minutes before event at which - /// notification will be sent. - /// The webhook URL to which the notification - /// will be sent. + + /// If notifications are enabled for this schedule (i.e. Enabled, Disabled). + /// Possible values include: 'Disabled', 'Enabled' + + /// Time in minutes before event at which notification will be sent. + /// + + /// The webhook URL to which the notification will be sent. + /// public NotificationSettingsFragment(string status = default(string), int? timeInMinutes = default(int?), string webhookUrl = default(string)) + { - Status = status; - TimeInMinutes = timeInMinutes; - WebhookUrl = webhookUrl; + this.Status = status; + this.TimeInMinutes = timeInMinutes; + this.WebhookUrl = webhookUrl; CustomInit(); } @@ -51,26 +46,25 @@ public NotificationSettingsFragment() /// partial void CustomInit(); - /// - /// Gets or sets if notifications are enabled for this schedule (i.e. - /// Enabled, Disabled). Possible values include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } /// - /// Gets or sets time in minutes before event at which notification - /// will be sent. + /// Gets or sets if notifications are enabled for this schedule (i.e. Enabled, + /// Disabled). Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "timeInMinutes")] - public int? TimeInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets the webhook URL to which the notification will be + /// Gets or sets time in minutes before event at which notification will be /// sent. /// - [JsonProperty(PropertyName = "webhookUrl")] - public string WebhookUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeInMinutes")] + public int? TimeInMinutes {get; set; } + /// + /// Gets or sets the webhook URL to which the notification will be sent. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "webhookUrl")] + public string WebhookUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationStatus.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationStatus.cs index ca1802b8d9aa..5122c4032625 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationStatus.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationStatus.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for NotificationStatus. /// + + public static class NotificationStatus { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotifyParameters.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotifyParameters.cs index 973474b1ece8..ce49888fd808 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotifyParameters.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotifyParameters.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public NotifyParameters() /// /// Initializes a new instance of the NotifyParameters class. /// - /// The type of event (i.e. AutoShutdown, - /// Cost). Possible values include: 'AutoShutdown', 'Cost' - /// Properties for the notification in json - /// format. + + /// The type of event (i.e. AutoShutdown, Cost) + /// Possible values include: 'AutoShutdown', 'Cost' + + /// Properties for the notification in json format. + /// public NotifyParameters(string eventName = default(string), string jsonPayload = default(string)) + { - EventName = eventName; - JsonPayload = jsonPayload; + this.EventName = eventName; + this.JsonPayload = jsonPayload; CustomInit(); } @@ -45,18 +42,17 @@ public NotifyParameters() /// partial void CustomInit(); + /// - /// Gets or sets the type of event (i.e. AutoShutdown, Cost). Possible - /// values include: 'AutoShutdown', 'Cost' + /// Gets or sets the type of event (i.e. AutoShutdown, Cost) Possible values include: 'AutoShutdown', 'Cost' /// - [JsonProperty(PropertyName = "eventName")] - public string EventName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + public string EventName {get; set; } /// /// Gets or sets properties for the notification in json format. /// - [JsonProperty(PropertyName = "jsonPayload")] - public string JsonPayload { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "jsonPayload")] + public string JsonPayload {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationError.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationError.cs index 7fd87aa1d96c..430e5b266635 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationError.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationError.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public OperationError() /// /// Initializes a new instance of the OperationError class. /// - /// The error code of the operation error. - /// The error message of the operation - /// error. + + /// The error code of the operation error. + /// + + /// The error message of the operation error. + /// public OperationError(string code = default(string), string message = default(string)) + { - Code = code; - Message = message; + this.Code = code; + this.Message = message; CustomInit(); } @@ -44,17 +42,17 @@ public OperationError() /// partial void CustomInit(); + /// /// Gets or sets the error code of the operation error. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets the error message of the operation error. /// - [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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadata.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadata.cs index 8a637cbc3dde..7aa67649a8e4 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadata.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadata.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public OperationMetadata() /// /// Initializes a new instance of the OperationMetadata class. /// - /// Operation name: - /// {provider}/{resource}/{operation} - /// The object that describes the - /// operations + + /// Operation name: {provider}/{resource}/{operation} + /// + + /// The object that describes the operations + /// public OperationMetadata(string name = default(string), OperationMetadataDisplay display = default(OperationMetadataDisplay)) + { - Name = name; - Display = display; + this.Name = name; + this.Display = display; CustomInit(); } @@ -45,17 +42,17 @@ public OperationMetadata() /// partial void CustomInit(); + /// /// Gets or sets operation name: {provider}/{resource}/{operation} /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the object that describes the operations /// - [JsonProperty(PropertyName = "display")] - public OperationMetadataDisplay Display { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationMetadataDisplay Display {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadataDisplay.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadataDisplay.cs index 98bae28c96c3..c37892758b8f 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadataDisplay.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadataDisplay.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,25 @@ public OperationMetadataDisplay() /// /// Initializes a new instance of the OperationMetadataDisplay class. /// - /// Friendly name of the resource - /// provider - /// Resource type on which the operation is - /// performed. - /// Operation type: read, write, delete, - /// listKeys/action, etc. - /// Friendly name of the operation + + /// Friendly name of the resource provider + /// + + /// Resource type on which the operation is performed. + /// + + /// Operation type: read, write, delete, listKeys/action, etc. + /// + + /// Friendly name of the operation + /// public OperationMetadataDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -50,30 +50,29 @@ public OperationMetadataDisplay() /// partial void CustomInit(); + /// /// Gets or sets friendly name of the resource provider /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets resource type on which the operation is performed. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// - /// Gets or sets operation type: read, write, delete, listKeys/action, - /// etc. + /// Gets or sets operation type: read, write, delete, listKeys/action, etc. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets friendly name of the operation /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationResult.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationResult.cs index 7b0099cbe817..b0d375b52b68 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationResult.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationResult.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,32 @@ public OperationResult() /// /// Initializes a new instance of the OperationResult class. /// - /// The operation status. + + /// The operation status. + /// + /// The status code for the operation. - /// Possible values include: 'Continue', 'SwitchingProtocols', 'OK', - /// 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', - /// 'ResetContent', 'PartialContent', 'MultipleChoices', - /// 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', - /// 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', - /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', - /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', - /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', - /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', - /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', - /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', - /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', - /// 'GatewayTimeout', 'HttpVersionNotSupported' - /// Error details for the operation in case of a - /// failure. + /// Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', + /// 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + /// 'PartialContent', 'MultipleChoices', 'MovedPermanently', 'Redirect', + /// 'SeeOther', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', + /// 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + /// 'HttpVersionNotSupported' + + /// Error details for the operation in case of a failure. + /// public OperationResult(string status = default(string), string statusCode = default(string), OperationError error = default(OperationError)) + { - Status = status; - StatusCode = statusCode; - Error = error; + this.Status = status; + this.StatusCode = statusCode; + this.Error = error; CustomInit(); } @@ -59,36 +57,23 @@ public OperationResult() /// partial void CustomInit(); + /// /// Gets or sets the operation status. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets the status code for the operation. Possible values - /// include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', - /// 'Accepted', 'NonAuthoritativeInformation', 'NoContent', - /// 'ResetContent', 'PartialContent', 'MultipleChoices', - /// 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', - /// 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', - /// 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', - /// 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', - /// 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', - /// 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', - /// 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', - /// 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', - /// 'NotImplemented', 'BadGateway', 'ServiceUnavailable', - /// 'GatewayTimeout', 'HttpVersionNotSupported' + /// Gets or sets the status code for the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported' /// - [JsonProperty(PropertyName = "statusCode")] - public string StatusCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statusCode")] + public string StatusCode {get; set; } /// /// Gets or sets error details for the operation in case of a failure. /// - [JsonProperty(PropertyName = "error")] - public OperationError Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public OperationError Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Page.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Page.cs index 132d59834ce1..f202354a7ece 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Page.cs +++ b/src/DevTestLabs/DevTestLabs.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.DevTestLabs.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("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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParameterInfo.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParameterInfo.cs index 2a030f059c37..699195fbd9d6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParameterInfo.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParameterInfo.cs @@ -1,20 +1,14 @@ -// // 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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Information about an artifact's parameter. + /// Information about an artifact's parameter. /// public partial class ParameterInfo { @@ -29,12 +23,17 @@ public ParameterInfo() /// /// Initializes a new instance of the ParameterInfo class. /// - /// The name of the artifact parameter. - /// The value of the artifact parameter. + + /// The name of the artifact parameter. + /// + + /// The value of the artifact parameter. + /// public ParameterInfo(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -43,17 +42,17 @@ public ParameterInfo() /// partial void CustomInit(); + /// /// Gets or sets the name of the artifact parameter. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value of the artifact parameter. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParametersValueFileInfo.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParametersValueFileInfo.cs index 6db9a1fe0248..443d1e3c3685 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParametersValueFileInfo.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParametersValueFileInfo.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ParametersValueFileInfo() /// /// Initializes a new instance of the ParametersValueFileInfo class. /// - /// File name. - /// Contents of the file. + + /// File name. + /// + + /// Contents of the file. + /// public ParametersValueFileInfo(string fileName = default(string), object parametersValueInfo = default(object)) + { - FileName = fileName; - ParametersValueInfo = parametersValueInfo; + this.FileName = fileName; + this.ParametersValueInfo = parametersValueInfo; CustomInit(); } @@ -43,17 +42,17 @@ public ParametersValueFileInfo() /// partial void CustomInit(); + /// /// Gets or sets file name. /// - [JsonProperty(PropertyName = "fileName")] - public string FileName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fileName")] + public string FileName {get; set; } /// /// Gets or sets contents of the file. /// - [JsonProperty(PropertyName = "parametersValueInfo")] - public object ParametersValueInfo { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parametersValueInfo")] + public object ParametersValueInfo {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PercentageCostThresholdProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PercentageCostThresholdProperties.cs index 8e3bb0efb8c3..283778490333 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PercentageCostThresholdProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PercentageCostThresholdProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class PercentageCostThresholdProperties { /// - /// Initializes a new instance of the PercentageCostThresholdProperties - /// class. + /// Initializes a new instance of the PercentageCostThresholdProperties class. /// public PercentageCostThresholdProperties() { @@ -28,13 +21,15 @@ public PercentageCostThresholdProperties() } /// - /// Initializes a new instance of the PercentageCostThresholdProperties - /// class. + /// Initializes a new instance of the PercentageCostThresholdProperties class. /// - /// The cost threshold value. + + /// The cost threshold value. + /// public PercentageCostThresholdProperties(double? thresholdValue = default(double?)) + { - ThresholdValue = thresholdValue; + this.ThresholdValue = thresholdValue; CustomInit(); } @@ -43,11 +38,11 @@ public PercentageCostThresholdProperties() /// partial void CustomInit(); + /// /// Gets or sets the cost threshold value. /// - [JsonProperty(PropertyName = "thresholdValue")] - public double? ThresholdValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "thresholdValue")] + public double? ThresholdValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Policy.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Policy.cs index f7b7d259d107..c6fce4446f91 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Policy.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Policy.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A Policy. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Policy : Resource { /// @@ -34,43 +24,66 @@ public Policy() /// /// Initializes a new instance of the Policy class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The description of the policy. - /// The status of the policy. Possible values - /// include: 'Enabled', 'Disabled' - /// The fact name of the policy (e.g. - /// LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values - /// include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', - /// 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', - /// 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' - /// The fact data of the policy. - /// The threshold of the policy (i.e. a number - /// for MaxValuePolicy, and a JSON array of values for - /// AllowedValuesPolicy). - /// The evaluator type of the policy (i.e. - /// AllowedValuesPolicy, MaxValuePolicy). Possible values include: - /// 'AllowedValuesPolicy', 'MaxValuePolicy' - /// The creation date of the policy. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Policy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The description of the policy. + /// + + /// The status of the policy. + /// Possible values include: 'Enabled', 'Disabled' + + /// The fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. + /// Possible values include: 'UserOwnedLabVmCount', + /// 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', + /// 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + + /// The fact data of the policy. + /// + + /// The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON + /// array of values for AllowedValuesPolicy). + /// + + /// The evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). + /// Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + + /// The creation date of the policy. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public Policy(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), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Description = description; - Status = status; - FactName = factName; - FactData = factData; - Threshold = threshold; - EvaluatorType = evaluatorType; - CreatedDate = createdDate; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Description = description; + this.Status = status; + this.FactName = factName; + this.FactData = factData; + this.Threshold = threshold; + this.EvaluatorType = evaluatorType; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -79,68 +92,62 @@ public Policy() /// partial void CustomInit(); + /// /// Gets or sets the description of the policy. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the status of the policy. Possible values include: - /// 'Enabled', 'Disabled' + /// Gets or sets the status of the policy. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public string Status {get; set; } /// - /// Gets or sets the fact name of the policy (e.g. LabVmCount, - /// LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: - /// 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', - /// 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', - /// 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + /// Gets or sets the fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. Possible values include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' /// - [JsonProperty(PropertyName = "properties.factName")] - public string FactName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.factName")] + public string FactName {get; set; } /// /// Gets or sets the fact data of the policy. /// - [JsonProperty(PropertyName = "properties.factData")] - public string FactData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.factData")] + public string FactData {get; set; } /// - /// Gets or sets the threshold of the policy (i.e. a number for - /// MaxValuePolicy, and a JSON array of values for - /// AllowedValuesPolicy). + /// Gets or sets the threshold of the policy (i.e. a number for MaxValuePolicy, + /// and a JSON array of values for AllowedValuesPolicy). /// - [JsonProperty(PropertyName = "properties.threshold")] - public string Threshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.threshold")] + public string Threshold {get; set; } /// - /// Gets or sets the evaluator type of the policy (i.e. - /// AllowedValuesPolicy, MaxValuePolicy). Possible values include: - /// 'AllowedValuesPolicy', 'MaxValuePolicy' + /// Gets or sets the evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' /// - [JsonProperty(PropertyName = "properties.evaluatorType")] - public string EvaluatorType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.evaluatorType")] + public string EvaluatorType {get; set; } /// /// Gets the creation date of the policy. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyEvaluatorType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyEvaluatorType.cs index a4eb10ab44f0..6c8fcc602ffd 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyEvaluatorType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyEvaluatorType.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for PolicyEvaluatorType. /// + + public static class PolicyEvaluatorType { public const string AllowedValuesPolicy = "AllowedValuesPolicy"; public const string MaxValuePolicy = "MaxValuePolicy"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFactName.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFactName.cs index 6c528e2d86f2..2ebafb70a263 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFactName.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFactName.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.DevTestLabs.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for PolicyFactName. /// + + public static class PolicyFactName { public const string UserOwnedLabVmCount = "UserOwnedLabVmCount"; @@ -25,4 +22,4 @@ public static class PolicyFactName public const string UserOwnedLabVmCountInSubnet = "UserOwnedLabVmCountInSubnet"; public const string LabTargetCost = "LabTargetCost"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFragment.cs index e70b9de2384c..61558eda2e0c 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A Policy. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PolicyFragment : Resource { /// @@ -34,41 +24,62 @@ public PolicyFragment() /// /// Initializes a new instance of the PolicyFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The description of the policy. - /// The status of the policy. Possible values - /// include: 'Enabled', 'Disabled' - /// The fact name of the policy (e.g. - /// LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values - /// include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', - /// 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', - /// 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' - /// The fact data of the policy. - /// The threshold of the policy (i.e. a number - /// for MaxValuePolicy, and a JSON array of values for - /// AllowedValuesPolicy). - /// The evaluator type of the policy (i.e. - /// AllowedValuesPolicy, MaxValuePolicy). Possible values include: - /// 'AllowedValuesPolicy', 'MaxValuePolicy' - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public PolicyFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The description of the policy. + /// + + /// The status of the policy. + /// Possible values include: 'Enabled', 'Disabled' + + /// The fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. + /// Possible values include: 'UserOwnedLabVmCount', + /// 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', + /// 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + + /// The fact data of the policy. + /// + + /// The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON + /// array of values for AllowedValuesPolicy). + /// + + /// The evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). + /// Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public PolicyFragment(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), string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Description = description; - Status = status; - FactName = factName; - FactData = factData; - Threshold = threshold; - EvaluatorType = evaluatorType; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Description = description; + this.Status = status; + this.FactName = factName; + this.FactData = factData; + this.Threshold = threshold; + this.EvaluatorType = evaluatorType; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -77,62 +88,56 @@ public PolicyFragment() /// partial void CustomInit(); + /// /// Gets or sets the description of the policy. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the status of the policy. Possible values include: - /// 'Enabled', 'Disabled' + /// Gets or sets the status of the policy. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public string Status {get; set; } /// - /// Gets or sets the fact name of the policy (e.g. LabVmCount, - /// LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: - /// 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', - /// 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', - /// 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + /// Gets or sets the fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. Possible values include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' /// - [JsonProperty(PropertyName = "properties.factName")] - public string FactName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.factName")] + public string FactName {get; set; } /// /// Gets or sets the fact data of the policy. /// - [JsonProperty(PropertyName = "properties.factData")] - public string FactData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.factData")] + public string FactData {get; set; } /// - /// Gets or sets the threshold of the policy (i.e. a number for - /// MaxValuePolicy, and a JSON array of values for - /// AllowedValuesPolicy). + /// Gets or sets the threshold of the policy (i.e. a number for MaxValuePolicy, + /// and a JSON array of values for AllowedValuesPolicy). /// - [JsonProperty(PropertyName = "properties.threshold")] - public string Threshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.threshold")] + public string Threshold {get; set; } /// - /// Gets or sets the evaluator type of the policy (i.e. - /// AllowedValuesPolicy, MaxValuePolicy). Possible values include: - /// 'AllowedValuesPolicy', 'MaxValuePolicy' + /// Gets or sets the evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' /// - [JsonProperty(PropertyName = "properties.evaluatorType")] - public string EvaluatorType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.evaluatorType")] + public string EvaluatorType {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyProperties.cs new file mode 100644 index 000000000000..428b3a6ce689 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyProperties.cs @@ -0,0 +1,136 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a Policy. + /// + public partial class PolicyProperties + { + /// + /// Initializes a new instance of the PolicyProperties class. + /// + public PolicyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PolicyProperties class. + /// + + /// The description of the policy. + /// + + /// The status of the policy. + /// Possible values include: 'Enabled', 'Disabled' + + /// The fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. + /// Possible values include: 'UserOwnedLabVmCount', + /// 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', + /// 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + + /// The fact data of the policy. + /// + + /// The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON + /// array of values for AllowedValuesPolicy). + /// + + /// The evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). + /// Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + + /// The creation date of the policy. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public PolicyProperties(string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Description = description; + this.Status = status; + this.FactName = factName; + this.FactData = factData; + this.Threshold = threshold; + this.EvaluatorType = evaluatorType; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the description of the policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the status of the policy. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. Possible values include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "factName")] + public string FactName {get; set; } + + /// + /// Gets or sets the fact data of the policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "factData")] + public string FactData {get; set; } + + /// + /// Gets or sets the threshold of the policy (i.e. a number for MaxValuePolicy, + /// and a JSON array of values for AllowedValuesPolicy). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + public string Threshold {get; set; } + + /// + /// Gets or sets the evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "evaluatorType")] + public string EvaluatorType {get; set; } + + /// + /// Gets the creation date of the policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyPropertiesFragment.cs new file mode 100644 index 000000000000..e5c3d7e2c685 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyPropertiesFragment.cs @@ -0,0 +1,126 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a Policy. + /// + public partial class PolicyPropertiesFragment + { + /// + /// Initializes a new instance of the PolicyPropertiesFragment class. + /// + public PolicyPropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PolicyPropertiesFragment class. + /// + + /// The description of the policy. + /// + + /// The status of the policy. + /// Possible values include: 'Enabled', 'Disabled' + + /// The fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. + /// Possible values include: 'UserOwnedLabVmCount', + /// 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', + /// 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + + /// The fact data of the policy. + /// + + /// The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON + /// array of values for AllowedValuesPolicy). + /// + + /// The evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). + /// Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public PolicyPropertiesFragment(string description = default(string), string status = default(string), string factName = default(string), string factData = default(string), string threshold = default(string), string evaluatorType = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Description = description; + this.Status = status; + this.FactName = factName; + this.FactData = factData; + this.Threshold = threshold; + this.EvaluatorType = evaluatorType; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the description of the policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the status of the policy. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the fact name of the policy (e.g. LabVmCount, LabVmSize, + /// MaxVmsAllowedPerLab, etc. Possible values include: 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', 'UserOwnedLabVmCountInSubnet', 'LabTargetCost' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "factName")] + public string FactName {get; set; } + + /// + /// Gets or sets the fact data of the policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "factData")] + public string FactData {get; set; } + + /// + /// Gets or sets the threshold of the policy (i.e. a number for MaxValuePolicy, + /// and a JSON array of values for AllowedValuesPolicy). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + public string Threshold {get; set; } + + /// + /// Gets or sets the evaluator type of the policy (i.e. AllowedValuesPolicy, + /// MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "evaluatorType")] + public string EvaluatorType {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicySetResult.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicySetResult.cs index d4ce94a02670..8372cdc5ae24 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicySetResult.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicySetResult.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,18 @@ public PolicySetResult() /// /// Initializes a new instance of the PolicySetResult class. /// - /// A value indicating whether this policy set - /// evaluation has discovered violations. - /// The list of policy - /// violations. - public PolicySetResult(bool? hasError = default(bool?), IList policyViolations = default(IList)) + + /// A value indicating whether this policy set evaluation has discovered + /// violations. + /// + + /// The list of policy violations. + /// + public PolicySetResult(bool? hasError = default(bool?), System.Collections.Generic.IList policyViolations = default(System.Collections.Generic.IList)) + { - HasError = hasError; - PolicyViolations = policyViolations; + this.HasError = hasError; + this.PolicyViolations = policyViolations; CustomInit(); } @@ -47,18 +43,18 @@ public PolicySetResult() /// partial void CustomInit(); + /// - /// Gets or sets a value indicating whether this policy set evaluation - /// has discovered violations. + /// Gets or sets a value indicating whether this policy set evaluation has + /// discovered violations. /// - [JsonProperty(PropertyName = "hasError")] - public bool? HasError { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hasError")] + public bool? HasError {get; set; } /// /// Gets or sets the list of policy violations. /// - [JsonProperty(PropertyName = "policyViolations")] - public IList PolicyViolations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "policyViolations")] + public System.Collections.Generic.IList PolicyViolations {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyStatus.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyStatus.cs index be2760e1856e..a11d6aa3cf93 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyStatus.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyStatus.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for PolicyStatus. /// + + public static class PolicyStatus { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyViolation.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyViolation.cs index a2dcac6def61..371b7a0e1442 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyViolation.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyViolation.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public PolicyViolation() /// /// Initializes a new instance of the PolicyViolation class. /// - /// The code of the policy violation. - /// The message of the policy violation. + + /// The code of the policy violation. + /// + + /// The message of the policy violation. + /// public PolicyViolation(string code = default(string), string message = default(string)) + { - Code = code; - Message = message; + this.Code = code; + this.Message = message; CustomInit(); } @@ -43,17 +42,17 @@ public PolicyViolation() /// partial void CustomInit(); + /// /// Gets or sets the code of the policy violation. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets the message of the policy violation. /// - [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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Port.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Port.cs index 952dfaa69635..c630eea6e2dc 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Port.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Port.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public Port() /// /// Initializes a new instance of the Port class. /// - /// Protocol type of the port. Possible - /// values include: 'Tcp', 'Udp' - /// Backend port of the target virtual - /// machine. + + /// Protocol type of the port. + /// Possible values include: 'Tcp', 'Udp' + + /// Backend port of the target virtual machine. + /// public Port(string transportProtocol = default(string), int? backendPort = default(int?)) + { - TransportProtocol = transportProtocol; - BackendPort = backendPort; + this.TransportProtocol = transportProtocol; + this.BackendPort = backendPort; CustomInit(); } @@ -45,18 +42,17 @@ public Port() /// partial void CustomInit(); + /// - /// Gets or sets protocol type of the port. Possible values include: - /// 'Tcp', 'Udp' + /// Gets or sets protocol type of the port. Possible values include: 'Tcp', 'Udp' /// - [JsonProperty(PropertyName = "transportProtocol")] - public string TransportProtocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "transportProtocol")] + public string TransportProtocol {get; set; } /// /// Gets or sets backend port of the target virtual machine. /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PortFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PortFragment.cs index ccf98f72fa22..365e29c006b1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PortFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PortFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public PortFragment() /// /// Initializes a new instance of the PortFragment class. /// - /// Protocol type of the port. Possible - /// values include: 'Tcp', 'Udp' - /// Backend port of the target virtual - /// machine. + + /// Protocol type of the port. + /// Possible values include: 'Tcp', 'Udp' + + /// Backend port of the target virtual machine. + /// public PortFragment(string transportProtocol = default(string), int? backendPort = default(int?)) + { - TransportProtocol = transportProtocol; - BackendPort = backendPort; + this.TransportProtocol = transportProtocol; + this.BackendPort = backendPort; CustomInit(); } @@ -45,18 +42,17 @@ public PortFragment() /// partial void CustomInit(); + /// - /// Gets or sets protocol type of the port. Possible values include: - /// 'Tcp', 'Udp' + /// Gets or sets protocol type of the port. Possible values include: 'Tcp', 'Udp' /// - [JsonProperty(PropertyName = "transportProtocol")] - public string TransportProtocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "transportProtocol")] + public string TransportProtocol {get; set; } /// /// Gets or sets backend port of the target virtual machine. /// - [JsonProperty(PropertyName = "backendPort")] - public int? BackendPort { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backendPort")] + public int? BackendPort {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PremiumDataDisk.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PremiumDataDisk.cs index 93be3e948363..92e300364695 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PremiumDataDisk.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PremiumDataDisk.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for PremiumDataDisk. /// + + public static class PremiumDataDisk { public const string Disabled = "Disabled"; public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ReportingCycleType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ReportingCycleType.cs index d4b5a9a92876..03e0b6fb31df 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ReportingCycleType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ReportingCycleType.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for ReportingCycleType. /// + + public static class ReportingCycleType { public const string CalendarMonth = "CalendarMonth"; public const string Custom = "Custom"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Resource.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Resource.cs index 065a5d37a329..2319efe74553 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Resource.cs +++ b/src/DevTestLabs/DevTestLabs.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// An Azure resource. /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -33,18 +23,29 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + public Resource(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)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Tags = tags; CustomInit(); } @@ -53,35 +54,35 @@ public Resource() /// partial void CustomInit(); + /// /// Gets the identifier of the 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 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 resource. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets the location of the resource. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets the tags of the resource. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/RetargetScheduleProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/RetargetScheduleProperties.cs index dc97ef5917aa..8fd8de30b827 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/RetargetScheduleProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/RetargetScheduleProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,18 @@ public RetargetScheduleProperties() /// /// Initializes a new instance of the RetargetScheduleProperties class. /// - /// The resource Id of the virtual - /// machine on which the schedule operates - /// The resource Id of the virtual - /// machine that the schedule should be retargeted to + + /// The resource Id of the virtual machine on which the schedule operates + /// + + /// The resource Id of the virtual machine that the schedule should be + /// retargeted to + /// public RetargetScheduleProperties(string currentResourceId = default(string), string targetResourceId = default(string)) + { - CurrentResourceId = currentResourceId; - TargetResourceId = targetResourceId; + this.CurrentResourceId = currentResourceId; + this.TargetResourceId = targetResourceId; CustomInit(); } @@ -45,19 +43,19 @@ public RetargetScheduleProperties() /// partial void CustomInit(); + /// - /// Gets or sets the resource Id of the virtual machine on which the - /// schedule operates + /// Gets or sets the resource Id of the virtual machine on which the schedule + /// operates /// - [JsonProperty(PropertyName = "currentResourceId")] - public string CurrentResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "currentResourceId")] + public string CurrentResourceId {get; set; } /// - /// Gets or sets the resource Id of the virtual machine that the - /// schedule should be retargeted to + /// Gets or sets the resource Id of the virtual machine that the schedule + /// should be retargeted to /// - [JsonProperty(PropertyName = "targetResourceId")] - public string TargetResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Schedule.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Schedule.cs index dbf967b4cf3a..5519392b30f0 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Schedule.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Schedule.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A schedule. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Schedule : Resource { /// @@ -34,46 +24,72 @@ public Schedule() /// /// Initializes a new instance of the Schedule class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The status of the schedule (i.e. Enabled, - /// Disabled). Possible values include: 'Enabled', 'Disabled' - /// The task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some - /// days of the week, specify the weekly recurrence. - /// If the schedule will occur once each - /// day of the week, specify the daily recurrence. - /// If the schedule will occur multiple - /// times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard - /// time). - /// Notification settings. - /// The creation date of the - /// schedule. - /// The resource ID to which the - /// schedule belongs - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Schedule(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string status = default(string), string taskType = default(string), WeekDetails weeklyRecurrence = default(WeekDetails), DayDetails dailyRecurrence = default(DayDetails), HourDetails hourlyRecurrence = default(HourDetails), string timeZoneId = default(string), NotificationSettings notificationSettings = default(NotificationSettings), System.DateTime? createdDate = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// Notification settings. + /// + + /// The status of the schedule (i.e. Enabled, Disabled) + /// Possible values include: 'Enabled', 'Disabled' + + /// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + /// + + /// If the schedule will occur only some days of the week, specify the weekly + /// recurrence. + /// + + /// If the schedule will occur once each day of the week, specify the daily + /// recurrence. + /// + + /// If the schedule will occur multiple times a day, specify the hourly + /// recurrence. + /// + + /// The time zone ID (e.g. Pacific Standard time). + /// + + /// The creation date of the schedule. + /// + + /// The resource ID to which the schedule belongs + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public Schedule(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), NotificationSettings notificationSettings = default(NotificationSettings), string status = default(string), string taskType = default(string), WeekDetails weeklyRecurrence = default(WeekDetails), DayDetails dailyRecurrence = default(DayDetails), HourDetails hourlyRecurrence = default(HourDetails), string timeZoneId = default(string), System.DateTime? createdDate = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Status = status; - TaskType = taskType; - WeeklyRecurrence = weeklyRecurrence; - DailyRecurrence = dailyRecurrence; - HourlyRecurrence = hourlyRecurrence; - TimeZoneId = timeZoneId; - NotificationSettings = notificationSettings; - CreatedDate = createdDate; - TargetResourceId = targetResourceId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.NotificationSettings = notificationSettings; + this.Status = status; + this.TaskType = taskType; + this.WeeklyRecurrence = weeklyRecurrence; + this.DailyRecurrence = dailyRecurrence; + this.HourlyRecurrence = hourlyRecurrence; + this.TimeZoneId = timeZoneId; + this.CreatedDate = createdDate; + this.TargetResourceId = targetResourceId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -82,76 +98,75 @@ public Schedule() /// partial void CustomInit(); + /// - /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). - /// Possible values include: 'Enabled', 'Disabled' + /// Gets or sets notification settings. /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notificationSettings")] + public NotificationSettings NotificationSettings {get; set; } /// - /// Gets or sets the task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled) Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.taskType")] - public string TaskType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public string Status {get; set; } /// - /// Gets or sets if the schedule will occur only some days of the week, - /// specify the weekly recurrence. + /// Gets or sets the task type of the schedule (e.g. LabVmsShutdownTask, + /// LabVmAutoStart). /// - [JsonProperty(PropertyName = "properties.weeklyRecurrence")] - public WeekDetails WeeklyRecurrence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.taskType")] + public string TaskType {get; set; } /// - /// Gets or sets if the schedule will occur once each day of the week, - /// specify the daily recurrence. + /// Gets or sets if the schedule will occur only some days of the week, specify + /// the weekly recurrence. /// - [JsonProperty(PropertyName = "properties.dailyRecurrence")] - public DayDetails DailyRecurrence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklyRecurrence")] + public WeekDetails WeeklyRecurrence {get; set; } /// - /// Gets or sets if the schedule will occur multiple times a day, - /// specify the hourly recurrence. + /// Gets or sets if the schedule will occur once each day of the week, specify + /// the daily recurrence. /// - [JsonProperty(PropertyName = "properties.hourlyRecurrence")] - public HourDetails HourlyRecurrence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailyRecurrence")] + public DayDetails DailyRecurrence {get; set; } /// - /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// Gets or sets if the schedule will occur multiple times a day, specify the + /// hourly recurrence. /// - [JsonProperty(PropertyName = "properties.timeZoneId")] - public string TimeZoneId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hourlyRecurrence")] + public HourDetails HourlyRecurrence {get; set; } /// - /// Gets or sets notification settings. + /// Gets or sets the time zone ID (e.g. Pacific Standard time). /// - [JsonProperty(PropertyName = "properties.notificationSettings")] - public NotificationSettings NotificationSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeZoneId")] + public string TimeZoneId {get; set; } /// /// Gets the creation date of the schedule. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the resource ID to which the schedule belongs /// - [JsonProperty(PropertyName = "properties.targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetResourceId")] + public string TargetResourceId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleFragment.cs index 44431e77725f..27f0f9fc9723 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A schedule. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ScheduleFragment : Resource { /// @@ -34,43 +24,68 @@ public ScheduleFragment() /// /// Initializes a new instance of the ScheduleFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The status of the schedule (i.e. Enabled, - /// Disabled). Possible values include: 'Enabled', 'Disabled' - /// The task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some - /// days of the week, specify the weekly recurrence. - /// If the schedule will occur once each - /// day of the week, specify the daily recurrence. - /// If the schedule will occur multiple - /// times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard - /// time). - /// Notification settings. - /// The resource ID to which the - /// schedule belongs - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public ScheduleFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string status = default(string), string taskType = default(string), WeekDetailsFragment weeklyRecurrence = default(WeekDetailsFragment), DayDetailsFragment dailyRecurrence = default(DayDetailsFragment), HourDetailsFragment hourlyRecurrence = default(HourDetailsFragment), string timeZoneId = default(string), NotificationSettingsFragment notificationSettings = default(NotificationSettingsFragment), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The status of the schedule (i.e. Enabled, Disabled) + /// Possible values include: 'Enabled', 'Disabled' + + /// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + /// + + /// If the schedule will occur only some days of the week, specify the weekly + /// recurrence. + /// + + /// If the schedule will occur once each day of the week, specify the daily + /// recurrence. + /// + + /// If the schedule will occur multiple times a day, specify the hourly + /// recurrence. + /// + + /// The time zone ID (e.g. Pacific Standard time). + /// + + /// Notification settings. + /// + + /// The resource ID to which the schedule belongs + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public ScheduleFragment(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), string status = default(string), string taskType = default(string), WeekDetailsFragment weeklyRecurrence = default(WeekDetailsFragment), DayDetailsFragment dailyRecurrence = default(DayDetailsFragment), HourDetailsFragment hourlyRecurrence = default(HourDetailsFragment), string timeZoneId = default(string), NotificationSettingsFragment notificationSettings = default(NotificationSettingsFragment), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Status = status; - TaskType = taskType; - WeeklyRecurrence = weeklyRecurrence; - DailyRecurrence = dailyRecurrence; - HourlyRecurrence = hourlyRecurrence; - TimeZoneId = timeZoneId; - NotificationSettings = notificationSettings; - TargetResourceId = targetResourceId; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Status = status; + this.TaskType = taskType; + this.WeeklyRecurrence = weeklyRecurrence; + this.DailyRecurrence = dailyRecurrence; + this.HourlyRecurrence = hourlyRecurrence; + this.TimeZoneId = timeZoneId; + this.NotificationSettings = notificationSettings; + this.TargetResourceId = targetResourceId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -79,70 +94,69 @@ public ScheduleFragment() /// partial void CustomInit(); + /// - /// Gets or sets the status of the schedule (i.e. Enabled, Disabled). - /// Possible values include: 'Enabled', 'Disabled' + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled) Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public string Status {get; set; } /// - /// Gets or sets the task type of the schedule (e.g. - /// LabVmsShutdownTask, LabVmAutoStart). + /// Gets or sets the task type of the schedule (e.g. LabVmsShutdownTask, + /// LabVmAutoStart). /// - [JsonProperty(PropertyName = "properties.taskType")] - public string TaskType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.taskType")] + public string TaskType {get; set; } /// - /// Gets or sets if the schedule will occur only some days of the week, - /// specify the weekly recurrence. + /// Gets or sets if the schedule will occur only some days of the week, specify + /// the weekly recurrence. /// - [JsonProperty(PropertyName = "properties.weeklyRecurrence")] - public WeekDetailsFragment WeeklyRecurrence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklyRecurrence")] + public WeekDetailsFragment WeeklyRecurrence {get; set; } /// - /// Gets or sets if the schedule will occur once each day of the week, - /// specify the daily recurrence. + /// Gets or sets if the schedule will occur once each day of the week, specify + /// the daily recurrence. /// - [JsonProperty(PropertyName = "properties.dailyRecurrence")] - public DayDetailsFragment DailyRecurrence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailyRecurrence")] + public DayDetailsFragment DailyRecurrence {get; set; } /// - /// Gets or sets if the schedule will occur multiple times a day, - /// specify the hourly recurrence. + /// Gets or sets if the schedule will occur multiple times a day, specify the + /// hourly recurrence. /// - [JsonProperty(PropertyName = "properties.hourlyRecurrence")] - public HourDetailsFragment HourlyRecurrence { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hourlyRecurrence")] + public HourDetailsFragment HourlyRecurrence {get; set; } /// /// Gets or sets the time zone ID (e.g. Pacific Standard time). /// - [JsonProperty(PropertyName = "properties.timeZoneId")] - public string TimeZoneId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeZoneId")] + public string TimeZoneId {get; set; } /// /// Gets or sets notification settings. /// - [JsonProperty(PropertyName = "properties.notificationSettings")] - public NotificationSettingsFragment NotificationSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notificationSettings")] + public NotificationSettingsFragment NotificationSettings {get; set; } /// /// Gets or sets the resource ID to which the schedule belongs /// - [JsonProperty(PropertyName = "properties.targetResourceId")] - public string TargetResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetResourceId")] + public string TargetResourceId {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleProperties.cs new file mode 100644 index 000000000000..e2eb2a1760c0 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleProperties.cs @@ -0,0 +1,155 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a schedule. + /// + public partial class ScheduleProperties + { + /// + /// Initializes a new instance of the ScheduleProperties class. + /// + public ScheduleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduleProperties class. + /// + + /// The status of the schedule (i.e. Enabled, Disabled) + /// Possible values include: 'Enabled', 'Disabled' + + /// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + /// + + /// If the schedule will occur only some days of the week, specify the weekly + /// recurrence. + /// + + /// If the schedule will occur once each day of the week, specify the daily + /// recurrence. + /// + + /// If the schedule will occur multiple times a day, specify the hourly + /// recurrence. + /// + + /// The time zone ID (e.g. Pacific Standard time). + /// + + /// Notification settings. + /// + + /// The creation date of the schedule. + /// + + /// The resource ID to which the schedule belongs + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public ScheduleProperties(string status = default(string), string taskType = default(string), WeekDetails weeklyRecurrence = default(WeekDetails), DayDetails dailyRecurrence = default(DayDetails), HourDetails hourlyRecurrence = default(HourDetails), string timeZoneId = default(string), NotificationSettings notificationSettings = default(NotificationSettings), System.DateTime? createdDate = default(System.DateTime?), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Status = status; + this.TaskType = taskType; + this.WeeklyRecurrence = weeklyRecurrence; + this.DailyRecurrence = dailyRecurrence; + this.HourlyRecurrence = hourlyRecurrence; + this.TimeZoneId = timeZoneId; + this.NotificationSettings = notificationSettings; + this.CreatedDate = createdDate; + this.TargetResourceId = targetResourceId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled) Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. LabVmsShutdownTask, + /// LabVmAutoStart). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "taskType")] + public string TaskType {get; set; } + + /// + /// Gets or sets if the schedule will occur only some days of the week, specify + /// the weekly recurrence. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "weeklyRecurrence")] + public WeekDetails WeeklyRecurrence {get; set; } + + /// + /// Gets or sets if the schedule will occur once each day of the week, specify + /// the daily recurrence. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dailyRecurrence")] + public DayDetails DailyRecurrence {get; set; } + + /// + /// Gets or sets if the schedule will occur multiple times a day, specify the + /// hourly recurrence. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hourlyRecurrence")] + public HourDetails HourlyRecurrence {get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZoneId")] + public string TimeZoneId {get; set; } + + /// + /// Gets or sets notification settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notificationSettings")] + public NotificationSettings NotificationSettings {get; set; } + + /// + /// Gets the creation date of the schedule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SchedulePropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SchedulePropertiesFragment.cs new file mode 100644 index 000000000000..3fa59447b223 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SchedulePropertiesFragment.cs @@ -0,0 +1,145 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a schedule. + /// + public partial class SchedulePropertiesFragment + { + /// + /// Initializes a new instance of the SchedulePropertiesFragment class. + /// + public SchedulePropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SchedulePropertiesFragment class. + /// + + /// The status of the schedule (i.e. Enabled, Disabled) + /// Possible values include: 'Enabled', 'Disabled' + + /// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + /// + + /// If the schedule will occur only some days of the week, specify the weekly + /// recurrence. + /// + + /// If the schedule will occur once each day of the week, specify the daily + /// recurrence. + /// + + /// If the schedule will occur multiple times a day, specify the hourly + /// recurrence. + /// + + /// The time zone ID (e.g. Pacific Standard time). + /// + + /// Notification settings. + /// + + /// The resource ID to which the schedule belongs + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public SchedulePropertiesFragment(string status = default(string), string taskType = default(string), WeekDetailsFragment weeklyRecurrence = default(WeekDetailsFragment), DayDetailsFragment dailyRecurrence = default(DayDetailsFragment), HourDetailsFragment hourlyRecurrence = default(HourDetailsFragment), string timeZoneId = default(string), NotificationSettingsFragment notificationSettings = default(NotificationSettingsFragment), string targetResourceId = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Status = status; + this.TaskType = taskType; + this.WeeklyRecurrence = weeklyRecurrence; + this.DailyRecurrence = dailyRecurrence; + this.HourlyRecurrence = hourlyRecurrence; + this.TimeZoneId = timeZoneId; + this.NotificationSettings = notificationSettings; + this.TargetResourceId = targetResourceId; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the status of the schedule (i.e. Enabled, Disabled) Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the task type of the schedule (e.g. LabVmsShutdownTask, + /// LabVmAutoStart). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "taskType")] + public string TaskType {get; set; } + + /// + /// Gets or sets if the schedule will occur only some days of the week, specify + /// the weekly recurrence. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "weeklyRecurrence")] + public WeekDetailsFragment WeeklyRecurrence {get; set; } + + /// + /// Gets or sets if the schedule will occur once each day of the week, specify + /// the daily recurrence. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dailyRecurrence")] + public DayDetailsFragment DailyRecurrence {get; set; } + + /// + /// Gets or sets if the schedule will occur multiple times a day, specify the + /// hourly recurrence. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hourlyRecurrence")] + public HourDetailsFragment HourlyRecurrence {get; set; } + + /// + /// Gets or sets the time zone ID (e.g. Pacific Standard time). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZoneId")] + public string TimeZoneId {get; set; } + + /// + /// Gets or sets notification settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "notificationSettings")] + public NotificationSettingsFragment NotificationSettings {get; set; } + + /// + /// Gets or sets the resource ID to which the schedule belongs + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Secret.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Secret.cs index 026abc4f91dd..bc6f6d6a38fa 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Secret.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Secret.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A secret. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Secret : Resource { /// @@ -34,23 +24,37 @@ public Secret() /// /// Initializes a new instance of the Secret class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The value of the secret for secret - /// creation. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public Secret(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string value = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The value of the secret for secret creation. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public Secret(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), string value = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Value = value; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Value = value; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -59,23 +63,23 @@ public Secret() /// partial void CustomInit(); + /// /// Gets or sets the value of the secret for secret creation. /// - [JsonProperty(PropertyName = "properties.value")] - public string Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.value")] + public string Value {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SecretProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SecretProperties.cs new file mode 100644 index 000000000000..426c3e8cd196 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SecretProperties.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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a secret. + /// + public partial class SecretProperties + { + /// + /// Initializes a new instance of the SecretProperties class. + /// + public SecretProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecretProperties class. + /// + + /// The value of the secret for secret creation. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public SecretProperties(string value = default(string), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Value = value; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the value of the secret for secret creation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceRunner.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceRunner.cs index b6bec3e30b71..087fbdb8338c 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceRunner.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceRunner.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,29 @@ public ServiceRunner() /// /// Initializes a new instance of the ServiceRunner class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The identity of the resource. - public ServiceRunner(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IdentityProperties identity = default(IdentityProperties)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The identity of the resource. + /// + public ServiceRunner(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), IdentityProperties identity = default(IdentityProperties)) + + : base(id, name, type, location, tags) { - Identity = identity; + this.Identity = identity; CustomInit(); } @@ -49,11 +54,11 @@ public ServiceRunner() /// partial void CustomInit(); + /// /// Gets or sets the identity of the resource. /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public IdentityProperties Identity {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfiguration.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfiguration.cs index 710a96cbe20a..faf28f9e33c7 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfiguration.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfiguration.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class SharedPublicIpAddressConfiguration { /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfiguration class. + /// Initializes a new instance of the SharedPublicIpAddressConfiguration class. /// public SharedPublicIpAddressConfiguration() { @@ -31,13 +22,15 @@ public SharedPublicIpAddressConfiguration() } /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfiguration class. + /// Initializes a new instance of the SharedPublicIpAddressConfiguration class. /// - /// The incoming NAT rules - public SharedPublicIpAddressConfiguration(IList inboundNatRules = default(IList)) + + /// The incoming NAT rules + /// + public SharedPublicIpAddressConfiguration(System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList)) + { - InboundNatRules = inboundNatRules; + this.InboundNatRules = inboundNatRules; CustomInit(); } @@ -46,11 +39,11 @@ public SharedPublicIpAddressConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the incoming NAT rules /// - [JsonProperty(PropertyName = "inboundNatRules")] - public IList InboundNatRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs index 336c77faa8cd..d3291b2e23a2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfigurationFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class SharedPublicIpAddressConfigurationFragment { /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfigurationFragment class. + /// Initializes a new instance of the SharedPublicIpAddressConfigurationFragment class. /// public SharedPublicIpAddressConfigurationFragment() { @@ -31,13 +22,15 @@ public SharedPublicIpAddressConfigurationFragment() } /// - /// Initializes a new instance of the - /// SharedPublicIpAddressConfigurationFragment class. + /// Initializes a new instance of the SharedPublicIpAddressConfigurationFragment class. /// - /// The incoming NAT rules - public SharedPublicIpAddressConfigurationFragment(IList inboundNatRules = default(IList)) + + /// The incoming NAT rules + /// + public SharedPublicIpAddressConfigurationFragment(System.Collections.Generic.IList inboundNatRules = default(System.Collections.Generic.IList)) + { - InboundNatRules = inboundNatRules; + this.InboundNatRules = inboundNatRules; CustomInit(); } @@ -46,11 +39,11 @@ public SharedPublicIpAddressConfigurationFragment() /// partial void CustomInit(); + /// /// Gets or sets the incoming NAT rules /// - [JsonProperty(PropertyName = "inboundNatRules")] - public IList InboundNatRules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "inboundNatRules")] + public System.Collections.Generic.IList InboundNatRules {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ShutdownNotificationContent.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ShutdownNotificationContent.cs index 7821c7413bc5..2a84f6ecffa6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ShutdownNotificationContent.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ShutdownNotificationContent.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -21,8 +15,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class ShutdownNotificationContent { /// - /// Initializes a new instance of the ShutdownNotificationContent - /// class. + /// Initializes a new instance of the ShutdownNotificationContent class. /// public ShutdownNotificationContent() { @@ -30,39 +23,55 @@ public ShutdownNotificationContent() } /// - /// Initializes a new instance of the ShutdownNotificationContent - /// class. + /// Initializes a new instance of the ShutdownNotificationContent class. /// - /// The URL to skip auto-shutdown. - /// The URL to delay shutdown by 60 - /// minutes. - /// The URL to delay shutdown by 2 - /// hours. - /// The virtual machine to be shut down. - /// The GUID for the virtual machine to be shut - /// down. - /// The owner of the virtual machine. - /// The event for which a notification will be - /// sent. - /// The text for the notification. - /// The subscription ID for the - /// schedule. - /// The resource group name for the - /// schedule. - /// The lab for the schedule. + + /// The URL to skip auto-shutdown. + /// + + /// The URL to delay shutdown by 60 minutes. + /// + + /// The URL to delay shutdown by 2 hours. + /// + + /// The virtual machine to be shut down. + /// + + /// The GUID for the virtual machine to be shut down. + /// + + /// The owner of the virtual machine. + /// + + /// The event for which a notification will be sent. + /// + + /// The text for the notification. + /// + + /// The subscription ID for the schedule. + /// + + /// The resource group name for the schedule. + /// + + /// The lab for the schedule. + /// public ShutdownNotificationContent(string skipUrl = default(string), string delayUrl60 = default(string), string delayUrl120 = default(string), string vmName = default(string), string guid = default(string), string owner = default(string), string eventType = default(string), string text = default(string), string subscriptionId = default(string), string resourceGroupName = default(string), string labName = default(string)) + { - SkipUrl = skipUrl; - DelayUrl60 = delayUrl60; - DelayUrl120 = delayUrl120; - VmName = vmName; - Guid = guid; - Owner = owner; - EventType = eventType; - Text = text; - SubscriptionId = subscriptionId; - ResourceGroupName = resourceGroupName; - LabName = labName; + this.SkipUrl = skipUrl; + this.DelayUrl60 = delayUrl60; + this.DelayUrl120 = delayUrl120; + this.VMName = vmName; + this.Guid = guid; + this.Owner = owner; + this.EventType = eventType; + this.Text = text; + this.SubscriptionId = subscriptionId; + this.ResourceGroupName = resourceGroupName; + this.LabName = labName; CustomInit(); } @@ -71,71 +80,71 @@ public ShutdownNotificationContent() /// partial void CustomInit(); + /// /// Gets or sets the URL to skip auto-shutdown. /// - [JsonProperty(PropertyName = "skipUrl")] - public string SkipUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "skipUrl")] + public string SkipUrl {get; set; } /// /// Gets or sets the URL to delay shutdown by 60 minutes. /// - [JsonProperty(PropertyName = "delayUrl60")] - public string DelayUrl60 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "delayUrl60")] + public string DelayUrl60 {get; set; } /// /// Gets or sets the URL to delay shutdown by 2 hours. /// - [JsonProperty(PropertyName = "delayUrl120")] - public string DelayUrl120 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "delayUrl120")] + public string DelayUrl120 {get; set; } /// /// Gets or sets the virtual machine to be shut down. /// - [JsonProperty(PropertyName = "vmName")] - public string VmName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmName")] + public string VMName {get; set; } /// /// Gets or sets the GUID for the virtual machine to be shut down. /// - [JsonProperty(PropertyName = "guid")] - public string Guid { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "guid")] + public string Guid {get; set; } /// /// Gets or sets the owner of the virtual machine. /// - [JsonProperty(PropertyName = "owner")] - public string Owner { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "owner")] + public string Owner {get; set; } /// /// Gets or sets the event for which a notification will be sent. /// - [JsonProperty(PropertyName = "eventType")] - public string EventType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eventType")] + public string EventType {get; set; } /// /// Gets or sets the text for the notification. /// - [JsonProperty(PropertyName = "text")] - public string Text { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "text")] + public string Text {get; set; } /// /// Gets or sets the subscription ID for the schedule. /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId {get; set; } /// /// Gets or sets the resource group name for the schedule. /// - [JsonProperty(PropertyName = "resourceGroupName")] - public string ResourceGroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupName")] + public string ResourceGroupName {get; set; } /// /// Gets or sets the lab for the schedule. /// - [JsonProperty(PropertyName = "labName")] - public string LabName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "labName")] + public string LabName {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SourceControlType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SourceControlType.cs index 971c18e93a54..6326b6a79b1d 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SourceControlType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SourceControlType.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for SourceControlType. /// + + public static class SourceControlType { public const string VsoGit = "VsoGit"; public const string GitHub = "GitHub"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/StorageType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/StorageType.cs index 54e99c938c3e..52852464f326 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/StorageType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/StorageType.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for StorageType. /// + + public static class StorageType { public const string Standard = "Standard"; public const string Premium = "Premium"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Subnet.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Subnet.cs index ff6eae4914cd..b8a453af0da5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Subnet.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Subnet.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,22 @@ public Subnet() /// /// Initializes a new instance of the Subnet class. /// - /// The resource ID of the subnet. - /// The name of the subnet as seen in the - /// lab. - /// The permission policy of the subnet for - /// allowing public IP addresses (i.e. Allow, Deny)). Possible values - /// include: 'Default', 'Deny', 'Allow' - public Subnet(string resourceId = default(string), string labSubnetName = default(string), string allowPublicIp = default(string)) + + /// The resource ID of the subnet. + /// + + /// The name of the subnet as seen in the lab. + /// + + /// The permission policy of the subnet for allowing public IP addresses (i.e. + /// Allow, Deny)). + /// Possible values include: 'Default', 'Deny', 'Allow' + public Subnet(string resourceId = default(string), string labSubnetName = default(string), string allowPublicIP = default(string)) + { - ResourceId = resourceId; - LabSubnetName = labSubnetName; - AllowPublicIp = allowPublicIp; + this.ResourceId = resourceId; + this.LabSubnetName = labSubnetName; + this.AllowPublicIP = allowPublicIP; CustomInit(); } @@ -48,25 +47,24 @@ public Subnet() /// partial void CustomInit(); + /// /// Gets or sets the resource ID of the subnet. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the name of the subnet as seen in the lab. /// - [JsonProperty(PropertyName = "labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets the permission policy of the subnet for allowing - /// public IP addresses (i.e. Allow, Deny)). Possible values include: - /// 'Default', 'Deny', 'Allow' + /// Gets or sets the permission policy of the subnet for allowing public IP + /// addresses (i.e. Allow, Deny)). Possible values include: 'Default', 'Deny', 'Allow' /// - [JsonProperty(PropertyName = "allowPublicIp")] - public string AllowPublicIp { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allowPublicIp")] + public string AllowPublicIP {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetFragment.cs index 4d98ebc44731..3016eccf28c6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,22 @@ public SubnetFragment() /// /// Initializes a new instance of the SubnetFragment class. /// - /// The resource ID of the subnet. - /// The name of the subnet as seen in the - /// lab. - /// The permission policy of the subnet for - /// allowing public IP addresses (i.e. Allow, Deny)). Possible values - /// include: 'Default', 'Deny', 'Allow' - public SubnetFragment(string resourceId = default(string), string labSubnetName = default(string), string allowPublicIp = default(string)) + + /// The resource ID of the subnet. + /// + + /// The name of the subnet as seen in the lab. + /// + + /// The permission policy of the subnet for allowing public IP addresses (i.e. + /// Allow, Deny)). + /// Possible values include: 'Default', 'Deny', 'Allow' + public SubnetFragment(string resourceId = default(string), string labSubnetName = default(string), string allowPublicIP = default(string)) + { - ResourceId = resourceId; - LabSubnetName = labSubnetName; - AllowPublicIp = allowPublicIp; + this.ResourceId = resourceId; + this.LabSubnetName = labSubnetName; + this.AllowPublicIP = allowPublicIP; CustomInit(); } @@ -48,25 +47,24 @@ public SubnetFragment() /// partial void CustomInit(); + /// /// Gets or sets the resource ID of the subnet. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the name of the subnet as seen in the lab. /// - [JsonProperty(PropertyName = "labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets the permission policy of the subnet for allowing - /// public IP addresses (i.e. Allow, Deny)). Possible values include: - /// 'Default', 'Deny', 'Allow' + /// Gets or sets the permission policy of the subnet for allowing public IP + /// addresses (i.e. Allow, Deny)). Possible values include: 'Default', 'Deny', 'Allow' /// - [JsonProperty(PropertyName = "allowPublicIp")] - public string AllowPublicIp { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allowPublicIp")] + public string AllowPublicIP {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverride.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverride.cs index 8c3389b70183..d24869e8cfaf 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverride.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverride.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,35 @@ public SubnetOverride() /// /// Initializes a new instance of the SubnetOverride class. /// - /// The resource ID of the subnet. - /// The name given to the subnet within the - /// lab. - /// Indicates whether this - /// subnet can be used during virtual machine creation (i.e. Allow, - /// Deny). Possible values include: 'Default', 'Deny', 'Allow' - /// Indicates whether public - /// IP addresses can be assigned to virtual machines on this subnet - /// (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', - /// 'Allow' - /// Properties that - /// virtual machines on this subnet will share. - /// The virtual network pool - /// associated with this subnet. - public SubnetOverride(string resourceId = default(string), string labSubnetName = default(string), string useInVmCreationPermission = default(string), string usePublicIpAddressPermission = default(string), SubnetSharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration = default(SubnetSharedPublicIpAddressConfiguration), string virtualNetworkPoolName = default(string)) + + /// The resource ID of the subnet. + /// + + /// The name given to the subnet within the lab. + /// + + /// Indicates whether this subnet can be used during virtual machine creation + /// (i.e. Allow, Deny). + /// Possible values include: 'Default', 'Deny', 'Allow' + + /// Indicates whether public IP addresses can be assigned to virtual machines + /// on this subnet (i.e. Allow, Deny). + /// Possible values include: 'Default', 'Deny', 'Allow' + + /// Properties that virtual machines on this subnet will share. + /// + + /// The virtual network pool associated with this subnet. + /// + public SubnetOverride(string resourceId = default(string), string labSubnetName = default(string), string useInVMCreationPermission = default(string), string usePublicIPAddressPermission = default(string), SubnetSharedPublicIpAddressConfiguration sharedPublicIPAddressConfiguration = default(SubnetSharedPublicIpAddressConfiguration), string virtualNetworkPoolName = default(string)) + { - ResourceId = resourceId; - LabSubnetName = labSubnetName; - UseInVmCreationPermission = useInVmCreationPermission; - UsePublicIpAddressPermission = usePublicIpAddressPermission; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; - VirtualNetworkPoolName = virtualNetworkPoolName; + this.ResourceId = resourceId; + this.LabSubnetName = labSubnetName; + this.UseInVMCreationPermission = useInVMCreationPermission; + this.UsePublicIPAddressPermission = usePublicIPAddressPermission; + this.SharedPublicIPAddressConfiguration = sharedPublicIPAddressConfiguration; + this.VirtualNetworkPoolName = virtualNetworkPoolName; CustomInit(); } @@ -59,46 +60,43 @@ public SubnetOverride() /// partial void CustomInit(); + /// /// Gets or sets the resource ID of the subnet. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the name given to the subnet within the lab. /// - [JsonProperty(PropertyName = "labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets indicates whether this subnet can be used during - /// virtual machine creation (i.e. Allow, Deny). Possible values - /// include: 'Default', 'Deny', 'Allow' + /// Gets or sets indicates whether this subnet can be used during virtual + /// machine creation (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', 'Allow' /// - [JsonProperty(PropertyName = "useInVmCreationPermission")] - public string UseInVmCreationPermission { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "useInVmCreationPermission")] + public string UseInVMCreationPermission {get; set; } /// - /// Gets or sets indicates whether public IP addresses can be assigned - /// to virtual machines on this subnet (i.e. Allow, Deny). Possible - /// values include: 'Default', 'Deny', 'Allow' + /// Gets or sets indicates whether public IP addresses can be assigned to + /// virtual machines on this subnet (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', 'Allow' /// - [JsonProperty(PropertyName = "usePublicIpAddressPermission")] - public string UsePublicIpAddressPermission { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "usePublicIpAddressPermission")] + public string UsePublicIPAddressPermission {get; set; } /// - /// Gets or sets properties that virtual machines on this subnet will - /// share. + /// Gets or sets properties that virtual machines on this subnet will share. /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SubnetSharedPublicIpAddressConfiguration SharedPublicIpAddressConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] + public SubnetSharedPublicIpAddressConfiguration SharedPublicIPAddressConfiguration {get; set; } /// /// Gets or sets the virtual network pool associated with this subnet. /// - [JsonProperty(PropertyName = "virtualNetworkPoolName")] - public string VirtualNetworkPoolName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkPoolName")] + public string VirtualNetworkPoolName {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverrideFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverrideFragment.cs index 4aa35009a12b..1799f9ddd1ba 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverrideFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverrideFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,35 @@ public SubnetOverrideFragment() /// /// Initializes a new instance of the SubnetOverrideFragment class. /// - /// The resource ID of the subnet. - /// The name given to the subnet within the - /// lab. - /// Indicates whether this - /// subnet can be used during virtual machine creation (i.e. Allow, - /// Deny). Possible values include: 'Default', 'Deny', 'Allow' - /// Indicates whether public - /// IP addresses can be assigned to virtual machines on this subnet - /// (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', - /// 'Allow' - /// Properties that - /// virtual machines on this subnet will share. - /// The virtual network pool - /// associated with this subnet. - public SubnetOverrideFragment(string resourceId = default(string), string labSubnetName = default(string), string useInVmCreationPermission = default(string), string usePublicIpAddressPermission = default(string), SubnetSharedPublicIpAddressConfigurationFragment sharedPublicIpAddressConfiguration = default(SubnetSharedPublicIpAddressConfigurationFragment), string virtualNetworkPoolName = default(string)) + + /// The resource ID of the subnet. + /// + + /// The name given to the subnet within the lab. + /// + + /// Indicates whether this subnet can be used during virtual machine creation + /// (i.e. Allow, Deny). + /// Possible values include: 'Default', 'Deny', 'Allow' + + /// Indicates whether public IP addresses can be assigned to virtual machines + /// on this subnet (i.e. Allow, Deny). + /// Possible values include: 'Default', 'Deny', 'Allow' + + /// Properties that virtual machines on this subnet will share. + /// + + /// The virtual network pool associated with this subnet. + /// + public SubnetOverrideFragment(string resourceId = default(string), string labSubnetName = default(string), string useInVMCreationPermission = default(string), string usePublicIPAddressPermission = default(string), SubnetSharedPublicIpAddressConfigurationFragment sharedPublicIPAddressConfiguration = default(SubnetSharedPublicIpAddressConfigurationFragment), string virtualNetworkPoolName = default(string)) + { - ResourceId = resourceId; - LabSubnetName = labSubnetName; - UseInVmCreationPermission = useInVmCreationPermission; - UsePublicIpAddressPermission = usePublicIpAddressPermission; - SharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; - VirtualNetworkPoolName = virtualNetworkPoolName; + this.ResourceId = resourceId; + this.LabSubnetName = labSubnetName; + this.UseInVMCreationPermission = useInVMCreationPermission; + this.UsePublicIPAddressPermission = usePublicIPAddressPermission; + this.SharedPublicIPAddressConfiguration = sharedPublicIPAddressConfiguration; + this.VirtualNetworkPoolName = virtualNetworkPoolName; CustomInit(); } @@ -59,46 +60,43 @@ public SubnetOverrideFragment() /// partial void CustomInit(); + /// /// Gets or sets the resource ID of the subnet. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the name given to the subnet within the lab. /// - [JsonProperty(PropertyName = "labSubnetName")] - public string LabSubnetName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "labSubnetName")] + public string LabSubnetName {get; set; } /// - /// Gets or sets indicates whether this subnet can be used during - /// virtual machine creation (i.e. Allow, Deny). Possible values - /// include: 'Default', 'Deny', 'Allow' + /// Gets or sets indicates whether this subnet can be used during virtual + /// machine creation (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', 'Allow' /// - [JsonProperty(PropertyName = "useInVmCreationPermission")] - public string UseInVmCreationPermission { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "useInVmCreationPermission")] + public string UseInVMCreationPermission {get; set; } /// - /// Gets or sets indicates whether public IP addresses can be assigned - /// to virtual machines on this subnet (i.e. Allow, Deny). Possible - /// values include: 'Default', 'Deny', 'Allow' + /// Gets or sets indicates whether public IP addresses can be assigned to + /// virtual machines on this subnet (i.e. Allow, Deny). Possible values include: 'Default', 'Deny', 'Allow' /// - [JsonProperty(PropertyName = "usePublicIpAddressPermission")] - public string UsePublicIpAddressPermission { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "usePublicIpAddressPermission")] + public string UsePublicIPAddressPermission {get; set; } /// - /// Gets or sets properties that virtual machines on this subnet will - /// share. + /// Gets or sets properties that virtual machines on this subnet will share. /// - [JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] - public SubnetSharedPublicIpAddressConfigurationFragment SharedPublicIpAddressConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedPublicIpAddressConfiguration")] + public SubnetSharedPublicIpAddressConfigurationFragment SharedPublicIPAddressConfiguration {get; set; } /// /// Gets or sets the virtual network pool associated with this subnet. /// - [JsonProperty(PropertyName = "virtualNetworkPoolName")] - public string VirtualNetworkPoolName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkPoolName")] + public string VirtualNetworkPoolName {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs index 611403e7b2e5..8d697cd39740 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfiguration.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class SubnetSharedPublicIpAddressConfiguration { /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfiguration class. + /// Initializes a new instance of the SubnetSharedPublicIpAddressConfiguration class. /// public SubnetSharedPublicIpAddressConfiguration() { @@ -30,14 +21,15 @@ public SubnetSharedPublicIpAddressConfiguration() } /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfiguration class. + /// Initializes a new instance of the SubnetSharedPublicIpAddressConfiguration class. /// - /// Backend ports that virtual machines on - /// this subnet are allowed to expose - public SubnetSharedPublicIpAddressConfiguration(IList allowedPorts = default(IList)) + + /// Backend ports that virtual machines on this subnet are allowed to expose + /// + public SubnetSharedPublicIpAddressConfiguration(System.Collections.Generic.IList allowedPorts = default(System.Collections.Generic.IList)) + { - AllowedPorts = allowedPorts; + this.AllowedPorts = allowedPorts; CustomInit(); } @@ -46,12 +38,12 @@ public SubnetSharedPublicIpAddressConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets backend ports that virtual machines on this subnet are - /// allowed to expose + /// Gets or sets backend ports that virtual machines on this subnet are allowed + /// to expose /// - [JsonProperty(PropertyName = "allowedPorts")] - public IList AllowedPorts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allowedPorts")] + public System.Collections.Generic.IList AllowedPorts {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs index 561d700b10e7..58c484bc2ee3 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models public partial class SubnetSharedPublicIpAddressConfigurationFragment { /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfigurationFragment class. + /// Initializes a new instance of the SubnetSharedPublicIpAddressConfigurationFragment class. /// public SubnetSharedPublicIpAddressConfigurationFragment() { @@ -30,14 +21,15 @@ public SubnetSharedPublicIpAddressConfigurationFragment() } /// - /// Initializes a new instance of the - /// SubnetSharedPublicIpAddressConfigurationFragment class. + /// Initializes a new instance of the SubnetSharedPublicIpAddressConfigurationFragment class. /// - /// Backend ports that virtual machines on - /// this subnet are allowed to expose - public SubnetSharedPublicIpAddressConfigurationFragment(IList allowedPorts = default(IList)) + + /// Backend ports that virtual machines on this subnet are allowed to expose + /// + public SubnetSharedPublicIpAddressConfigurationFragment(System.Collections.Generic.IList allowedPorts = default(System.Collections.Generic.IList)) + { - AllowedPorts = allowedPorts; + this.AllowedPorts = allowedPorts; CustomInit(); } @@ -46,12 +38,12 @@ public SubnetSharedPublicIpAddressConfigurationFragment() /// partial void CustomInit(); + /// - /// Gets or sets backend ports that virtual machines on this subnet are - /// allowed to expose + /// Gets or sets backend ports that virtual machines on this subnet are allowed + /// to expose /// - [JsonProperty(PropertyName = "allowedPorts")] - public IList AllowedPorts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allowedPorts")] + public System.Collections.Generic.IList AllowedPorts {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostProperties.cs index b873e4154670..8585ef488981 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostProperties.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostProperties.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,23 +23,33 @@ public TargetCostProperties() /// /// Initializes a new instance of the TargetCostProperties class. /// - /// Target cost status. Possible values include: - /// 'Enabled', 'Disabled' - /// Lab target cost - /// Cost thresholds. - /// Reporting cycle start - /// date. - /// Reporting cycle end date. - /// Reporting cycle type. Possible values - /// include: 'CalendarMonth', 'Custom' - public TargetCostProperties(string status = default(string), int? target = default(int?), IList costThresholds = default(IList), System.DateTime? cycleStartDateTime = default(System.DateTime?), System.DateTime? cycleEndDateTime = default(System.DateTime?), string cycleType = default(string)) + + /// Target cost status + /// Possible values include: 'Enabled', 'Disabled' + + /// Lab target cost + /// + + /// Cost thresholds. + /// + + /// Reporting cycle start date. + /// + + /// Reporting cycle end date. + /// + + /// Reporting cycle type. + /// Possible values include: 'CalendarMonth', 'Custom' + public TargetCostProperties(string status = default(string), int? target = default(int?), System.Collections.Generic.IList costThresholds = default(System.Collections.Generic.IList), System.DateTime? cycleStartDateTime = default(System.DateTime?), System.DateTime? cycleEndDateTime = default(System.DateTime?), string cycleType = default(string)) + { - Status = status; - Target = target; - CostThresholds = costThresholds; - CycleStartDateTime = cycleStartDateTime; - CycleEndDateTime = cycleEndDateTime; - CycleType = cycleType; + this.Status = status; + this.Target = target; + this.CostThresholds = costThresholds; + this.CycleStartDateTime = cycleStartDateTime; + this.CycleEndDateTime = cycleEndDateTime; + this.CycleType = cycleType; CustomInit(); } @@ -56,43 +58,41 @@ public TargetCostProperties() /// partial void CustomInit(); + /// - /// Gets or sets target cost status. Possible values include: - /// 'Enabled', 'Disabled' + /// Gets or sets target cost status Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets lab target cost /// - [JsonProperty(PropertyName = "target")] - public int? Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public int? Target {get; set; } /// /// Gets or sets cost thresholds. /// - [JsonProperty(PropertyName = "costThresholds")] - public IList CostThresholds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "costThresholds")] + public System.Collections.Generic.IList CostThresholds {get; set; } /// /// Gets or sets reporting cycle start date. /// - [JsonProperty(PropertyName = "cycleStartDateTime")] - public System.DateTime? CycleStartDateTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cycleStartDateTime")] + public System.DateTime? CycleStartDateTime {get; set; } /// /// Gets or sets reporting cycle end date. /// - [JsonProperty(PropertyName = "cycleEndDateTime")] - public System.DateTime? CycleEndDateTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cycleEndDateTime")] + public System.DateTime? CycleEndDateTime {get; set; } /// - /// Gets or sets reporting cycle type. Possible values include: - /// 'CalendarMonth', 'Custom' + /// Gets or sets reporting cycle type. Possible values include: 'CalendarMonth', 'Custom' /// - [JsonProperty(PropertyName = "cycleType")] - public string CycleType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "cycleType")] + public string CycleType {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostStatus.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostStatus.cs index 09e9960f369b..922c1481e423 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostStatus.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostStatus.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for TargetCostStatus. /// + + public static class TargetCostStatus { public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TransportProtocol.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TransportProtocol.cs index 6c16537b3406..0974b2aab3e6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TransportProtocol.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TransportProtocol.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for TransportProtocol. /// + + public static class TransportProtocol { public const string Tcp = "Tcp"; public const string Udp = "Udp"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UsagePermissionType.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UsagePermissionType.cs index d5715cf73a8c..29a2c9d2c1d2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UsagePermissionType.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UsagePermissionType.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.DevTestLabs.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for UsagePermissionType. /// + + public static class UsagePermissionType { public const string Default = "Default"; public const string Deny = "Deny"; public const string Allow = "Allow"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/User.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/User.cs index 7cd5069725ea..bd36e740e425 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/User.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/User.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Profile of a lab user. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class User : Resource { /// @@ -34,27 +24,45 @@ public User() /// /// Initializes a new instance of the User class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The identity of the user. - /// The secret store of the user. - /// The creation date of the user - /// profile. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public User(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), UserIdentity identity = default(UserIdentity), UserSecretStore secretStore = default(UserSecretStore), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The identity of the user. + /// + + /// The secret store of the user. + /// + + /// The creation date of the user profile. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public User(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), UserIdentity identity = default(UserIdentity), UserSecretStore secretStore = default(UserSecretStore), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Identity = identity; - SecretStore = secretStore; - CreatedDate = createdDate; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Identity = identity; + this.SecretStore = secretStore; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -63,35 +71,35 @@ public User() /// partial void CustomInit(); + /// /// Gets or sets the identity of the user. /// - [JsonProperty(PropertyName = "properties.identity")] - public UserIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identity")] + public UserIdentity Identity {get; set; } /// /// Gets or sets the secret store of the user. /// - [JsonProperty(PropertyName = "properties.secretStore")] - public UserSecretStore SecretStore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secretStore")] + public UserSecretStore SecretStore {get; set; } /// /// Gets the creation date of the user profile. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserFragment.cs index a761054ed318..c3d7c2702de7 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Profile of a lab user. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class UserFragment : Resource { /// @@ -34,24 +24,41 @@ public UserFragment() /// /// Initializes a new instance of the UserFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The identity of the user. - /// The secret store of the user. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public UserFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), UserIdentityFragment identity = default(UserIdentityFragment), UserSecretStoreFragment secretStore = default(UserSecretStoreFragment), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The identity of the user. + /// + + /// The secret store of the user. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public UserFragment(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), UserIdentityFragment identity = default(UserIdentityFragment), UserSecretStoreFragment secretStore = default(UserSecretStoreFragment), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - Identity = identity; - SecretStore = secretStore; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.Identity = identity; + this.SecretStore = secretStore; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -60,29 +67,29 @@ public UserFragment() /// partial void CustomInit(); + /// /// Gets or sets the identity of the user. /// - [JsonProperty(PropertyName = "properties.identity")] - public UserIdentityFragment Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identity")] + public UserIdentityFragment Identity {get; set; } /// /// Gets or sets the secret store of the user. /// - [JsonProperty(PropertyName = "properties.secretStore")] - public UserSecretStoreFragment SecretStore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.secretStore")] + public UserSecretStoreFragment SecretStore {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentity.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentity.cs index 4300315e3bd8..a7515273362f 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentity.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentity.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,26 +23,32 @@ public UserIdentity() /// /// Initializes a new instance of the UserIdentity class. /// - /// Set to the principal name / UPN of the - /// client JWT making the request. - /// Set to the principal Id of the client JWT - /// making the request. Service principal will not have the principal - /// Id. - /// Set to the tenant ID of the client JWT - /// making the request. - /// Set to the object Id of the client JWT - /// making the request. Not all users have object Id. For CSP - /// (reseller) scenarios for example, object Id is not - /// available. - /// Set to the app Id of the client JWT making the - /// request. + + /// Set to the principal name / UPN of the client JWT making the request. + /// + + /// Set to the principal Id of the client JWT making the request. Service + /// principal will not have the principal Id. + /// + + /// Set to the tenant ID of the client JWT making the request. + /// + + /// Set to the object Id of the client JWT making the request. Not all users + /// have object Id. For CSP (reseller) scenarios for example, object Id is not + /// available. + /// + + /// Set to the app Id of the client JWT making the request. + /// public UserIdentity(string principalName = default(string), string principalId = default(string), string tenantId = default(string), string objectId = default(string), string appId = default(string)) + { - PrincipalName = principalName; - PrincipalId = principalId; - TenantId = tenantId; - ObjectId = objectId; - AppId = appId; + this.PrincipalName = principalName; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.ObjectId = objectId; + this.AppId = appId; CustomInit(); } @@ -57,41 +57,39 @@ public UserIdentity() /// partial void CustomInit(); + /// - /// Gets or sets set to the principal name / UPN of the client JWT - /// making the request. + /// Gets or sets set to the principal name / UPN of the client JWT making the + /// request. /// - [JsonProperty(PropertyName = "principalName")] - public string PrincipalName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalName")] + public string PrincipalName {get; set; } /// - /// Gets or sets set to the principal Id of the client JWT making the - /// request. Service principal will not have the principal Id. + /// Gets or sets set to the principal Id of the client JWT making the request. + /// Service principal will not have the principal Id. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; set; } /// - /// Gets or sets set to the tenant ID of the client JWT making the - /// request. + /// Gets or sets set to the tenant ID of the client JWT making the request. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; set; } /// - /// Gets or sets set to the object Id of the client JWT making the - /// request. Not all users have object Id. For CSP (reseller) scenarios - /// for example, object Id is not available. + /// Gets or sets set to the object Id of the client JWT making the request. Not + /// all users have object Id. For CSP (reseller) scenarios for example, object + /// Id is not available. /// - [JsonProperty(PropertyName = "objectId")] - public string ObjectId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "objectId")] + public string ObjectId {get; set; } /// - /// Gets or sets set to the app Id of the client JWT making the - /// request. + /// Gets or sets set to the app Id of the client JWT making the request. /// - [JsonProperty(PropertyName = "appId")] - public string AppId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "appId")] + public string AppId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentityFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentityFragment.cs index da124b736c0c..360e39177e8c 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentityFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentityFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,26 +23,32 @@ public UserIdentityFragment() /// /// Initializes a new instance of the UserIdentityFragment class. /// - /// Set to the principal name / UPN of the - /// client JWT making the request. - /// Set to the principal Id of the client JWT - /// making the request. Service principal will not have the principal - /// Id. - /// Set to the tenant ID of the client JWT - /// making the request. - /// Set to the object Id of the client JWT - /// making the request. Not all users have object Id. For CSP - /// (reseller) scenarios for example, object Id is not - /// available. - /// Set to the app Id of the client JWT making the - /// request. + + /// Set to the principal name / UPN of the client JWT making the request. + /// + + /// Set to the principal Id of the client JWT making the request. Service + /// principal will not have the principal Id. + /// + + /// Set to the tenant ID of the client JWT making the request. + /// + + /// Set to the object Id of the client JWT making the request. Not all users + /// have object Id. For CSP (reseller) scenarios for example, object Id is not + /// available. + /// + + /// Set to the app Id of the client JWT making the request. + /// public UserIdentityFragment(string principalName = default(string), string principalId = default(string), string tenantId = default(string), string objectId = default(string), string appId = default(string)) + { - PrincipalName = principalName; - PrincipalId = principalId; - TenantId = tenantId; - ObjectId = objectId; - AppId = appId; + this.PrincipalName = principalName; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.ObjectId = objectId; + this.AppId = appId; CustomInit(); } @@ -57,41 +57,39 @@ public UserIdentityFragment() /// partial void CustomInit(); + /// - /// Gets or sets set to the principal name / UPN of the client JWT - /// making the request. + /// Gets or sets set to the principal name / UPN of the client JWT making the + /// request. /// - [JsonProperty(PropertyName = "principalName")] - public string PrincipalName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalName")] + public string PrincipalName {get; set; } /// - /// Gets or sets set to the principal Id of the client JWT making the - /// request. Service principal will not have the principal Id. + /// Gets or sets set to the principal Id of the client JWT making the request. + /// Service principal will not have the principal Id. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; set; } /// - /// Gets or sets set to the tenant ID of the client JWT making the - /// request. + /// Gets or sets set to the tenant ID of the client JWT making the request. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; set; } /// - /// Gets or sets set to the object Id of the client JWT making the - /// request. Not all users have object Id. For CSP (reseller) scenarios - /// for example, object Id is not available. + /// Gets or sets set to the object Id of the client JWT making the request. Not + /// all users have object Id. For CSP (reseller) scenarios for example, object + /// Id is not available. /// - [JsonProperty(PropertyName = "objectId")] - public string ObjectId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "objectId")] + public string ObjectId {get; set; } /// - /// Gets or sets set to the app Id of the client JWT making the - /// request. + /// Gets or sets set to the app Id of the client JWT making the request. /// - [JsonProperty(PropertyName = "appId")] - public string AppId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "appId")] + public string AppId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserProperties.cs new file mode 100644 index 000000000000..cd593f581cf0 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserProperties.cs @@ -0,0 +1,88 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a lab user profile. + /// + public partial class UserProperties + { + /// + /// Initializes a new instance of the UserProperties class. + /// + public UserProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserProperties class. + /// + + /// The identity of the user. + /// + + /// The secret store of the user. + /// + + /// The creation date of the user profile. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public UserProperties(UserIdentity identity = default(UserIdentity), UserSecretStore secretStore = default(UserSecretStore), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Identity = identity; + this.SecretStore = secretStore; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the identity of the user. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public UserIdentity Identity {get; set; } + + /// + /// Gets or sets the secret store of the user. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secretStore")] + public UserSecretStore SecretStore {get; set; } + + /// + /// Gets the creation date of the user profile. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserPropertiesFragment.cs new file mode 100644 index 000000000000..a3d6821a5a51 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserPropertiesFragment.cs @@ -0,0 +1,78 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a lab user profile. + /// + public partial class UserPropertiesFragment + { + /// + /// Initializes a new instance of the UserPropertiesFragment class. + /// + public UserPropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserPropertiesFragment class. + /// + + /// The identity of the user. + /// + + /// The secret store of the user. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public UserPropertiesFragment(UserIdentityFragment identity = default(UserIdentityFragment), UserSecretStoreFragment secretStore = default(UserSecretStoreFragment), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.Identity = identity; + this.SecretStore = secretStore; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the identity of the user. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public UserIdentityFragment Identity {get; set; } + + /// + /// Gets or sets the secret store of the user. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "secretStore")] + public UserSecretStoreFragment SecretStore {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStore.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStore.cs index 009e9f5bc1c7..b8a08876232b 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStore.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStore.cs @@ -1,20 +1,14 @@ -// // 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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Properties of a user's secret store. + /// Properties of a user's secret store. /// public partial class UserSecretStore { @@ -29,12 +23,17 @@ public UserSecretStore() /// /// Initializes a new instance of the UserSecretStore class. /// - /// The URI of the user's Key vault. - /// The ID of the user's Key vault. + + /// The URI of the user's Key vault. + /// + + /// The ID of the user's Key vault. + /// public UserSecretStore(string keyVaultUri = default(string), string keyVaultId = default(string)) + { - KeyVaultUri = keyVaultUri; - KeyVaultId = keyVaultId; + this.KeyVaultUri = keyVaultUri; + this.KeyVaultId = keyVaultId; CustomInit(); } @@ -43,17 +42,17 @@ public UserSecretStore() /// partial void CustomInit(); + /// - /// Gets or sets the URI of the user's Key vault. + /// Gets or sets the URI of the user's Key vault. /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri {get; set; } /// - /// Gets or sets the ID of the user's Key vault. + /// Gets or sets the ID of the user's Key vault. /// - [JsonProperty(PropertyName = "keyVaultId")] - public string KeyVaultId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultId")] + public string KeyVaultId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStoreFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStoreFragment.cs index b0c2bf8da693..b47a2fe79336 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStoreFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStoreFragment.cs @@ -1,20 +1,14 @@ -// // 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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Properties of a user's secret store. + /// Properties of a user's secret store. /// public partial class UserSecretStoreFragment { @@ -29,12 +23,17 @@ public UserSecretStoreFragment() /// /// Initializes a new instance of the UserSecretStoreFragment class. /// - /// The URI of the user's Key vault. - /// The ID of the user's Key vault. + + /// The URI of the user's Key vault. + /// + + /// The ID of the user's Key vault. + /// public UserSecretStoreFragment(string keyVaultUri = default(string), string keyVaultId = default(string)) + { - KeyVaultUri = keyVaultUri; - KeyVaultId = keyVaultId; + this.KeyVaultUri = keyVaultUri; + this.KeyVaultId = keyVaultId; CustomInit(); } @@ -43,17 +42,17 @@ public UserSecretStoreFragment() /// partial void CustomInit(); + /// - /// Gets or sets the URI of the user's Key vault. + /// Gets or sets the URI of the user's Key vault. /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri {get; set; } /// - /// Gets or sets the ID of the user's Key vault. + /// Gets or sets the ID of the user's Key vault. /// - [JsonProperty(PropertyName = "keyVaultId")] - public string KeyVaultId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultId")] + public string KeyVaultId {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualMachineCreationSource.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualMachineCreationSource.cs index 4899e4d31fb4..3af568a510c5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualMachineCreationSource.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualMachineCreationSource.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.DevTestLabs.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for VirtualMachineCreationSource. /// + + public static class VirtualMachineCreationSource { public const string FromCustomImage = "FromCustomImage"; public const string FromGalleryImage = "FromGalleryImage"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetwork.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetwork.cs index 3a27d184f4fc..f8dde6a443e5 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetwork.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetwork.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A virtual network. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetwork : Resource { /// @@ -34,38 +24,57 @@ public VirtualNetwork() /// /// Initializes a new instance of the VirtualNetwork class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The allowed subnets of the virtual - /// network. - /// The description of the virtual - /// network. - /// The Microsoft.Network - /// resource identifier of the virtual network. - /// The external subnet - /// properties. - /// The subnet overrides of the virtual - /// network. - /// The creation date of the virtual - /// network. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList allowedSubnets = default(IList), string description = default(string), string externalProviderResourceId = default(string), IList externalSubnets = default(IList), IList subnetOverrides = default(IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The allowed subnets of the virtual network. + /// + + /// The description of the virtual network. + /// + + /// The Microsoft.Network resource identifier of the virtual network. + /// + + /// The external subnet properties. + /// + + /// The subnet overrides of the virtual network. + /// + + /// The creation date of the virtual network. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public VirtualNetwork(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), System.Collections.Generic.IList allowedSubnets = default(System.Collections.Generic.IList), string description = default(string), string externalProviderResourceId = default(string), System.Collections.Generic.IList externalSubnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnetOverrides = default(System.Collections.Generic.IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - AllowedSubnets = allowedSubnets; - Description = description; - ExternalProviderResourceId = externalProviderResourceId; - ExternalSubnets = externalSubnets; - SubnetOverrides = subnetOverrides; - CreatedDate = createdDate; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.AllowedSubnets = allowedSubnets; + this.Description = description; + this.ExternalProviderResourceId = externalProviderResourceId; + this.ExternalSubnets = externalSubnets; + this.SubnetOverrides = subnetOverrides; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -74,54 +83,54 @@ public VirtualNetwork() /// partial void CustomInit(); + /// /// Gets or sets the allowed subnets of the virtual network. /// - [JsonProperty(PropertyName = "properties.allowedSubnets")] - public IList AllowedSubnets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowedSubnets")] + public System.Collections.Generic.IList AllowedSubnets {get; set; } /// /// Gets or sets the description of the virtual network. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the Microsoft.Network resource identifier of the - /// virtual network. + /// Gets or sets the Microsoft.Network resource identifier of the virtual + /// network. /// - [JsonProperty(PropertyName = "properties.externalProviderResourceId")] - public string ExternalProviderResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalProviderResourceId")] + public string ExternalProviderResourceId {get; set; } /// /// Gets or sets the external subnet properties. /// - [JsonProperty(PropertyName = "properties.externalSubnets")] - public IList ExternalSubnets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalSubnets")] + public System.Collections.Generic.IList ExternalSubnets {get; set; } /// /// Gets or sets the subnet overrides of the virtual network. /// - [JsonProperty(PropertyName = "properties.subnetOverrides")] - public IList SubnetOverrides { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnetOverrides")] + public System.Collections.Generic.IList SubnetOverrides {get; set; } /// /// Gets the creation date of the virtual network. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public System.DateTime? CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public System.DateTime? CreatedDate {get; private set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkFragment.cs index 7e795d721327..ae364e9d1ba2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkFragment.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.DevTestLabs.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A virtual network. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualNetworkFragment : Resource { /// @@ -34,35 +24,53 @@ public VirtualNetworkFragment() /// /// Initializes a new instance of the VirtualNetworkFragment class. /// - /// The identifier of the resource. - /// The name of the resource. - /// The type of the resource. - /// The location of the resource. - /// The tags of the resource. - /// The allowed subnets of the virtual - /// network. - /// The description of the virtual - /// network. - /// The Microsoft.Network - /// resource identifier of the virtual network. - /// The external subnet - /// properties. - /// The subnet overrides of the virtual - /// network. - /// The provisioning status of the - /// resource. - /// The unique immutable identifier of a - /// resource (Guid). - public VirtualNetworkFragment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList allowedSubnets = default(IList), string description = default(string), string externalProviderResourceId = default(string), IList externalSubnets = default(IList), IList subnetOverrides = default(IList), string provisioningState = default(string), string uniqueIdentifier = default(string)) - : base(id, name, type, location, tags) + + /// The identifier of the resource. + /// + + /// The name of the resource. + /// + + /// The type of the resource. + /// + + /// The location of the resource. + /// + + /// The tags of the resource. + /// + + /// The allowed subnets of the virtual network. + /// + + /// The description of the virtual network. + /// + + /// The Microsoft.Network resource identifier of the virtual network. + /// + + /// The external subnet properties. + /// + + /// The subnet overrides of the virtual network. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public VirtualNetworkFragment(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), System.Collections.Generic.IList allowedSubnets = default(System.Collections.Generic.IList), string description = default(string), string externalProviderResourceId = default(string), System.Collections.Generic.IList externalSubnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnetOverrides = default(System.Collections.Generic.IList), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + : base(id, name, type, location, tags) { - AllowedSubnets = allowedSubnets; - Description = description; - ExternalProviderResourceId = externalProviderResourceId; - ExternalSubnets = externalSubnets; - SubnetOverrides = subnetOverrides; - ProvisioningState = provisioningState; - UniqueIdentifier = uniqueIdentifier; + this.AllowedSubnets = allowedSubnets; + this.Description = description; + this.ExternalProviderResourceId = externalProviderResourceId; + this.ExternalSubnets = externalSubnets; + this.SubnetOverrides = subnetOverrides; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; CustomInit(); } @@ -71,48 +79,48 @@ public VirtualNetworkFragment() /// partial void CustomInit(); + /// /// Gets or sets the allowed subnets of the virtual network. /// - [JsonProperty(PropertyName = "properties.allowedSubnets")] - public IList AllowedSubnets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowedSubnets")] + public System.Collections.Generic.IList AllowedSubnets {get; set; } /// /// Gets or sets the description of the virtual network. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the Microsoft.Network resource identifier of the - /// virtual network. + /// Gets or sets the Microsoft.Network resource identifier of the virtual + /// network. /// - [JsonProperty(PropertyName = "properties.externalProviderResourceId")] - public string ExternalProviderResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalProviderResourceId")] + public string ExternalProviderResourceId {get; set; } /// /// Gets or sets the external subnet properties. /// - [JsonProperty(PropertyName = "properties.externalSubnets")] - public IList ExternalSubnets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalSubnets")] + public System.Collections.Generic.IList ExternalSubnets {get; set; } /// /// Gets or sets the subnet overrides of the virtual network. /// - [JsonProperty(PropertyName = "properties.subnetOverrides")] - public IList SubnetOverrides { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnetOverrides")] + public System.Collections.Generic.IList SubnetOverrides {get; set; } /// /// Gets or sets the provisioning status of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } /// /// Gets or sets the unique immutable identifier of a resource (Guid). /// - [JsonProperty(PropertyName = "properties.uniqueIdentifier")] - public string UniqueIdentifier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueIdentifier")] + public string UniqueIdentifier {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkProperties.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkProperties.cs new file mode 100644 index 000000000000..19170159dc64 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkProperties.cs @@ -0,0 +1,119 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a virtual network. + /// + public partial class VirtualNetworkProperties + { + /// + /// Initializes a new instance of the VirtualNetworkProperties class. + /// + public VirtualNetworkProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkProperties class. + /// + + /// The allowed subnets of the virtual network. + /// + + /// The description of the virtual network. + /// + + /// The Microsoft.Network resource identifier of the virtual network. + /// + + /// The external subnet properties. + /// + + /// The subnet overrides of the virtual network. + /// + + /// The creation date of the virtual network. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public VirtualNetworkProperties(System.Collections.Generic.IList allowedSubnets = default(System.Collections.Generic.IList), string description = default(string), string externalProviderResourceId = default(string), System.Collections.Generic.IList externalSubnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnetOverrides = default(System.Collections.Generic.IList), System.DateTime? createdDate = default(System.DateTime?), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.AllowedSubnets = allowedSubnets; + this.Description = description; + this.ExternalProviderResourceId = externalProviderResourceId; + this.ExternalSubnets = externalSubnets; + this.SubnetOverrides = subnetOverrides; + this.CreatedDate = createdDate; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the allowed subnets of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowedSubnets")] + public System.Collections.Generic.IList AllowedSubnets {get; set; } + + /// + /// Gets or sets the description of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the Microsoft.Network resource identifier of the virtual + /// network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalProviderResourceId")] + public string ExternalProviderResourceId {get; set; } + + /// + /// Gets or sets the external subnet properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalSubnets")] + public System.Collections.Generic.IList ExternalSubnets {get; set; } + + /// + /// Gets or sets the subnet overrides of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetOverrides")] + public System.Collections.Generic.IList SubnetOverrides {get; set; } + + /// + /// Gets the creation date of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public System.DateTime? CreatedDate {get; private set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFragment.cs new file mode 100644 index 000000000000..98a2e99a0291 --- /dev/null +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkPropertiesFragment.cs @@ -0,0 +1,109 @@ +// 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.DevTestLabs.Models +{ + using System.Linq; + + /// + /// Properties of a virtual network. + /// + public partial class VirtualNetworkPropertiesFragment + { + /// + /// Initializes a new instance of the VirtualNetworkPropertiesFragment class. + /// + public VirtualNetworkPropertiesFragment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkPropertiesFragment class. + /// + + /// The allowed subnets of the virtual network. + /// + + /// The description of the virtual network. + /// + + /// The Microsoft.Network resource identifier of the virtual network. + /// + + /// The external subnet properties. + /// + + /// The subnet overrides of the virtual network. + /// + + /// The provisioning status of the resource. + /// + + /// The unique immutable identifier of a resource (Guid). + /// + public VirtualNetworkPropertiesFragment(System.Collections.Generic.IList allowedSubnets = default(System.Collections.Generic.IList), string description = default(string), string externalProviderResourceId = default(string), System.Collections.Generic.IList externalSubnets = default(System.Collections.Generic.IList), System.Collections.Generic.IList subnetOverrides = default(System.Collections.Generic.IList), string provisioningState = default(string), string uniqueIdentifier = default(string)) + + { + this.AllowedSubnets = allowedSubnets; + this.Description = description; + this.ExternalProviderResourceId = externalProviderResourceId; + this.ExternalSubnets = externalSubnets; + this.SubnetOverrides = subnetOverrides; + this.ProvisioningState = provisioningState; + this.UniqueIdentifier = uniqueIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the allowed subnets of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowedSubnets")] + public System.Collections.Generic.IList AllowedSubnets {get; set; } + + /// + /// Gets or sets the description of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the Microsoft.Network resource identifier of the virtual + /// network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalProviderResourceId")] + public string ExternalProviderResourceId {get; set; } + + /// + /// Gets or sets the external subnet properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalSubnets")] + public System.Collections.Generic.IList ExternalSubnets {get; set; } + + /// + /// Gets or sets the subnet overrides of the virtual network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetOverrides")] + public System.Collections.Generic.IList SubnetOverrides {get; set; } + + /// + /// Gets or sets the provisioning status of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + + /// + /// Gets or sets the unique immutable identifier of a resource (Guid). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueIdentifier")] + public string UniqueIdentifier {get; set; } + } +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetails.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetails.cs index 528ecce78b17..3259956ca1b0 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetails.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetails.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,18 @@ public WeekDetails() /// /// Initializes a new instance of the WeekDetails class. /// - /// The days of the week for which the schedule - /// is set (e.g. Sunday, Monday, Tuesday, etc.). - /// The time of the day the schedule will - /// occur. - public WeekDetails(IList weekdays = default(IList), string time = default(string)) + + /// The days of the week for which the schedule is set (e.g. Sunday, Monday, + /// Tuesday, etc.). + /// + + /// The time of the day the schedule will occur. + /// + public WeekDetails(System.Collections.Generic.IList weekdays = default(System.Collections.Generic.IList), string time = default(string)) + { - Weekdays = weekdays; - Time = time; + this.Weekdays = weekdays; + this.Time = time; CustomInit(); } @@ -47,18 +43,18 @@ public WeekDetails() /// partial void CustomInit(); + /// - /// Gets or sets the days of the week for which the schedule is set - /// (e.g. Sunday, Monday, Tuesday, etc.). + /// Gets or sets the days of the week for which the schedule is set (e.g. + /// Sunday, Monday, Tuesday, etc.). /// - [JsonProperty(PropertyName = "weekdays")] - public IList Weekdays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "weekdays")] + public System.Collections.Generic.IList Weekdays {get; set; } /// /// Gets or sets the time of the day the schedule will occur. /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "time")] + public string Time {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetailsFragment.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetailsFragment.cs index ccc4a5195f54..ea53f93d4f0e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetailsFragment.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetailsFragment.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.DevTestLabs.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,18 @@ public WeekDetailsFragment() /// /// Initializes a new instance of the WeekDetailsFragment class. /// - /// The days of the week for which the schedule - /// is set (e.g. Sunday, Monday, Tuesday, etc.). - /// The time of the day the schedule will - /// occur. - public WeekDetailsFragment(IList weekdays = default(IList), string time = default(string)) + + /// The days of the week for which the schedule is set (e.g. Sunday, Monday, + /// Tuesday, etc.). + /// + + /// The time of the day the schedule will occur. + /// + public WeekDetailsFragment(System.Collections.Generic.IList weekdays = default(System.Collections.Generic.IList), string time = default(string)) + { - Weekdays = weekdays; - Time = time; + this.Weekdays = weekdays; + this.Time = time; CustomInit(); } @@ -47,18 +43,18 @@ public WeekDetailsFragment() /// partial void CustomInit(); + /// - /// Gets or sets the days of the week for which the schedule is set - /// (e.g. Sunday, Monday, Tuesday, etc.). + /// Gets or sets the days of the week for which the schedule is set (e.g. + /// Sunday, Monday, Tuesday, etc.). /// - [JsonProperty(PropertyName = "weekdays")] - public IList Weekdays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "weekdays")] + public System.Collections.Generic.IList Weekdays {get; set; } /// /// Gets or sets the time of the day the schedule will occur. /// - [JsonProperty(PropertyName = "time")] - public string Time { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "time")] + public string Time {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsInfo.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsInfo.cs index ecd2c48d18eb..0efc7b403976 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsInfo.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsInfo.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.DevTestLabs.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,15 @@ public WindowsOsInfo() /// /// Initializes a new instance of the WindowsOsInfo class. /// - /// The state of the Windows OS (i.e. - /// NonSysprepped, SysprepRequested, SysprepApplied). Possible values - /// include: 'NonSysprepped', 'SysprepRequested', - /// 'SysprepApplied' - public WindowsOsInfo(string windowsOsState = default(string)) + + /// The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + /// SysprepApplied). + /// Possible values include: 'NonSysprepped', 'SysprepRequested', + /// 'SysprepApplied' + public WindowsOsInfo(string windowsOSState = default(string)) + { - WindowsOsState = windowsOsState; + this.WindowsOSState = windowsOSState; CustomInit(); } @@ -44,13 +40,12 @@ public WindowsOsInfo() /// partial void CustomInit(); + /// /// Gets or sets the state of the Windows OS (i.e. NonSysprepped, - /// SysprepRequested, SysprepApplied). Possible values include: - /// 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' + /// SysprepRequested, SysprepApplied). Possible values include: 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' /// - [JsonProperty(PropertyName = "windowsOsState")] - public string WindowsOsState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "windowsOsState")] + public string WindowsOSState {get; set; } } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsState.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsState.cs index c97401fc9db1..f02e7aa9b563 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsState.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsState.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.DevTestLabs.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.DevTestLabs.Models /// /// Defines values for WindowsOsState. /// + + public static class WindowsOsState { public const string NonSysprepped = "NonSysprepped"; public const string SysprepRequested = "SysprepRequested"; public const string SysprepApplied = "SysprepApplied"; } -} +} \ No newline at end of file diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperations.cs index 1b5b7fbd7a03..2f5b8f48e0ea 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// NotificationChannelsOperations operations. /// - internal partial class NotificationChannelsOperations : IServiceOperations, INotificationChannelsOperations + internal partial class NotificationChannelsOperations : Microsoft.Rest.IServiceOperations, INotificationChannelsOperations { /// /// Initializes a new instance of the NotificationChannelsOperations class. @@ -37,13 +24,13 @@ internal partial class NotificationChannelsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NotificationChannelsOperations(DevTestLabsClient client) + internal NotificationChannelsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// List notificationchannels in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/notificationchannels").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _notificationChannel = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_notificationChannel)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_notificationChannel); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal NotificationChannelsOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal NotificationChannelsOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal NotificationChannelsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get notificationchannel. /// @@ -265,7 +270,7 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// The name of the notificationChannel. /// /// - /// Specify the $expand query. Example: 'properties($select=webHookUrl)' + /// Specify the $expand query. Example: 'properties($select=webHookUrl)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal NotificationChannelsOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/notificationchannels/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal NotificationChannelsOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal NotificationChannelsOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal NotificationChannelsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing notificationChannel. /// @@ -482,13 +506,13 @@ internal NotificationChannelsOperations(DevTestLabsClient 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 /// /// @@ -497,81 +521,94 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, NotificationChannel notificationChannel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, NotificationChannel notificationChannel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (notificationChannel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "notificationChannel"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (notificationChannel == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "notificationChannel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("notificationChannel", notificationChannel); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/notificationchannels/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -583,61 +620,62 @@ internal NotificationChannelsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(notificationChannel != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(notificationChannel, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(notificationChannel, 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); } + 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) @@ -647,9 +685,10 @@ internal NotificationChannelsOperations(DevTestLabsClient 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(); @@ -660,16 +699,16 @@ internal NotificationChannelsOperations(DevTestLabsClient 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 @@ -678,25 +717,29 @@ internal NotificationChannelsOperations(DevTestLabsClient 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 notificationchannel. /// @@ -712,10 +755,10 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -724,76 +767,88 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/notificationchannels/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -805,55 +860,56 @@ internal NotificationChannelsOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -863,20 +919,25 @@ internal NotificationChannelsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Modify properties of notificationchannels. /// @@ -895,13 +956,13 @@ internal NotificationChannelsOperations(DevTestLabsClient 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 /// /// @@ -910,81 +971,93 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string name, NotificationChannelFragment notificationChannel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, NotificationChannelFragment notificationChannel, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (notificationChannel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "notificationChannel"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (notificationChannel == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "notificationChannel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("notificationChannel", notificationChannel); + 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.DevTestLab/labs/{labName}/notificationchannels/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -996,61 +1069,62 @@ internal NotificationChannelsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(notificationChannel != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(notificationChannel, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(notificationChannel, 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); } + 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) @@ -1060,9 +1134,10 @@ internal NotificationChannelsOperations(DevTestLabsClient 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(); @@ -1073,25 +1148,29 @@ internal NotificationChannelsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Send notification to provided channel. /// @@ -1110,10 +1189,10 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1122,81 +1201,94 @@ internal NotificationChannelsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task NotifyWithHttpMessagesAsync(string labName, string name, NotifyParameters notifyParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task NotifyWithHttpMessagesAsync(string labName, string name, NotifyParameters notifyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (notifyParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "notifyParameters"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (notifyParameters == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "notifyParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("notifyParameters", notifyParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Notify", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Notify", 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.DevTestLab/labs/{labName}/notificationchannels/{name}/notify").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1208,61 +1300,62 @@ internal NotificationChannelsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(notifyParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(notifyParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(notifyParameters, 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); } + 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) @@ -1272,20 +1365,25 @@ internal NotificationChannelsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List notificationchannels in a given lab. /// @@ -1298,13 +1396,13 @@ internal NotificationChannelsOperations(DevTestLabsClient 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 /// /// @@ -1313,51 +1411,54 @@ internal NotificationChannelsOperations(DevTestLabsClient 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) @@ -1369,55 +1470,56 @@ internal NotificationChannelsOperations(DevTestLabsClient 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); } + 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) @@ -1427,9 +1529,10 @@ internal NotificationChannelsOperations(DevTestLabsClient 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(); @@ -1440,24 +1543,28 @@ internal NotificationChannelsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperationsExtensions.cs index a88399c64d25..7ffcc4f19268 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperationsExtensions.cs @@ -1,318 +1,283 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NotificationChannelsOperations. + /// Extension methods for NotificationChannelsOperations /// public static partial class NotificationChannelsOperationsExtensions { - /// - /// List notificationchannels in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this INotificationChannelsOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List notificationchannels in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INotificationChannelsOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get notificationchannel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// Specify the $expand query. Example: 'properties($select=webHookUrl)' - /// - public static NotificationChannel Get(this INotificationChannelsOperations operations, string labName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get notificationchannel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// Specify the $expand query. Example: 'properties($select=webHookUrl)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INotificationChannelsOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing notificationChannel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// A notification. - /// - public static NotificationChannel CreateOrUpdate(this INotificationChannelsOperations operations, string labName, string name, NotificationChannel notificationChannel) - { - return operations.CreateOrUpdateAsync(labName, name, notificationChannel).GetAwaiter().GetResult(); - } + /// + /// List notificationchannels in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this INotificationChannelsOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((INotificationChannelsOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing notificationChannel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// A notification. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INotificationChannelsOperations operations, string labName, string name, NotificationChannel notificationChannel, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List notificationchannels in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INotificationChannelsOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, notificationChannel, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get notificationchannel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + /// + /// Specify the $expand query. Example: 'properties($select=webHookUrl)' + /// + public static NotificationChannel Get(this INotificationChannelsOperations operations, string labName, string name, string expand = default(string)) + { + return ((INotificationChannelsOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Delete notificationchannel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - public static void Delete(this INotificationChannelsOperations operations, string labName, string name) + /// + /// Get notificationchannel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + /// + /// Specify the $expand query. Example: 'properties($select=webHookUrl)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INotificationChannelsOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing notificationChannel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + public static NotificationChannel CreateOrUpdate(this INotificationChannelsOperations operations, string labName, string name, NotificationChannel notificationChannel) + { + return ((INotificationChannelsOperations)operations).CreateOrUpdateAsync(labName, name, notificationChannel).GetAwaiter().GetResult(); + } - /// - /// Delete notificationchannel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INotificationChannelsOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing notificationChannel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this INotificationChannelsOperations operations, string labName, string name, NotificationChannel notificationChannel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, notificationChannel, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete notificationchannel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + public static void Delete(this INotificationChannelsOperations operations, string labName, string name) + { + ((INotificationChannelsOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Modify properties of notificationchannels. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// A notification. - /// - public static NotificationChannel Update(this INotificationChannelsOperations operations, string labName, string name, NotificationChannelFragment notificationChannel) - { - return operations.UpdateAsync(labName, name, notificationChannel).GetAwaiter().GetResult(); - } + /// + /// Delete notificationchannel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this INotificationChannelsOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of notificationchannels. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + public static NotificationChannel Update(this INotificationChannelsOperations operations, string labName, string name, NotificationChannelFragment notificationChannel) + { + return ((INotificationChannelsOperations)operations).UpdateAsync(labName, name, notificationChannel).GetAwaiter().GetResult(); + } - /// - /// Modify properties of notificationchannels. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// A notification. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this INotificationChannelsOperations operations, string labName, string name, NotificationChannelFragment notificationChannel, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of notificationchannels. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this INotificationChannelsOperations operations, string labName, string name, NotificationChannelFragment notificationChannel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, notificationChannel, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, notificationChannel, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Send notification to provided channel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + public static void Notify(this INotificationChannelsOperations operations, string labName, string name, NotifyParameters notifyParameters) + { + ((INotificationChannelsOperations)operations).NotifyAsync(labName, name, notifyParameters).GetAwaiter().GetResult(); + } - /// - /// Send notification to provided channel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// Properties for generating a Notification. - /// - public static void Notify(this INotificationChannelsOperations operations, string labName, string name, NotifyParameters notifyParameters) - { - operations.NotifyAsync(labName, name, notifyParameters).GetAwaiter().GetResult(); - } + /// + /// Send notification to provided channel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the notificationChannel. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task NotifyAsync(this INotificationChannelsOperations operations, string labName, string name, NotifyParameters notifyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.NotifyWithHttpMessagesAsync(labName, name, notifyParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List notificationchannels in a given lab. + /// + /// + /// 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 INotificationChannelsOperations operations, string nextPageLink) + { + return ((INotificationChannelsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Send notification to provided channel. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the notificationChannel. - /// - /// - /// Properties for generating a Notification. - /// - /// - /// The cancellation token. - /// - public static async Task NotifyAsync(this INotificationChannelsOperations operations, string labName, string name, NotifyParameters notifyParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List notificationchannels in a given lab. + /// + /// + /// 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 INotificationChannelsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.NotifyWithHttpMessagesAsync(labName, name, notifyParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// List notificationchannels in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this INotificationChannelsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List notificationchannels in a given lab. - /// - /// - /// 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 INotificationChannelsOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Operations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Operations.cs index 3b0bae030203..482d5a329730 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Operations.cs +++ b/src/DevTestLabs/DevTestLabs.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.DevTestLabs { + 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, IOper /// /// Thrown when a required parameter is null /// - internal Operations(DevTestLabsClient client) + internal Operations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal Operations(DevTestLabsClient 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 Operations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string locationName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string locationName, string name, 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 (locationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "locationName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("locationName", locationName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/locations/{locationName}/operations/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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,55 +155,56 @@ internal Operations(DevTestLabsClient 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); } + 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) @@ -214,9 +214,10 @@ internal Operations(DevTestLabsClient 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(); @@ -227,24 +228,28 @@ internal Operations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/OperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/OperationsExtensions.cs index 31bbdc304eb2..241e7290f43b 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/OperationsExtensions.cs @@ -1,65 +1,55 @@ -// // 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.DevTestLabs { - 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 { - /// - /// Get operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the location. - /// - /// - /// The name of the operation. - /// - public static OperationResult Get(this IOperations operations, string locationName, string name) - { - return operations.GetAsync(locationName, name).GetAwaiter().GetResult(); - } + /// + /// Get operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the location. + /// + /// + /// The name of the operation. + /// + public static OperationResult Get(this IOperations operations, string locationName, string name) + { + return ((IOperations)operations).GetAsync(locationName, name).GetAwaiter().GetResult(); + } - /// - /// Get operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the location. - /// - /// - /// The name of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IOperations operations, string locationName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the location. + /// + /// + /// The name of the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IOperations operations, string locationName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(locationName, name, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(locationName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperations.cs index 60a05ffeb240..1f4c44da5521 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// PoliciesOperations operations. /// - internal partial class PoliciesOperations : IServiceOperations, IPoliciesOperations + internal partial class PoliciesOperations : Microsoft.Rest.IServiceOperations, IPoliciesOperations { /// /// Initializes a new instance of the PoliciesOperations class. @@ -37,13 +24,13 @@ internal partial class PoliciesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PoliciesOperations(DevTestLabsClient client) + internal PoliciesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// List policies in a given policy set. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the policy set. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string policySetName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string policySetName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (policySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policySetName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("policySetName", policySetName); + + 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{policySetName}", System.Uri.EscapeDataString(policySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _policy = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_policy)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_policy); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal PoliciesOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal PoliciesOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal PoliciesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get policy. /// @@ -277,7 +283,7 @@ internal PoliciesOperations(DevTestLabsClient client) /// The name of the policy. /// /// - /// Specify the $expand query. Example: 'properties($select=description)' + /// Specify the $expand query. Example: 'properties($select=description)' /// /// /// Headers that will be added to request. @@ -285,13 +291,13 @@ internal PoliciesOperations(DevTestLabsClient 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 /// /// @@ -300,87 +306,101 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string policySetName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string policySetName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (policySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policySetName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("policySetName", policySetName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{policySetName}", System.Uri.EscapeDataString(policySetName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -392,55 +412,56 @@ internal PoliciesOperations(DevTestLabsClient 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); } + 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) @@ -450,9 +471,10 @@ internal PoliciesOperations(DevTestLabsClient 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(); @@ -463,25 +485,29 @@ internal PoliciesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing policy. /// @@ -503,13 +529,13 @@ internal PoliciesOperations(DevTestLabsClient 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 /// /// @@ -518,87 +544,101 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string policySetName, string name, Policy policy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string policySetName, string name, Policy policy, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (policy == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policy"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (policySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policySetName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (policy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "policy"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("policySetName", policySetName); tracingParameters.Add("name", name); + tracingParameters.Add("policy", policy); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{policySetName}", System.Uri.EscapeDataString(policySetName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -610,61 +650,62 @@ internal PoliciesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(policy != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(policy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(policy, 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); } + 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) @@ -674,9 +715,10 @@ internal PoliciesOperations(DevTestLabsClient 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(); @@ -687,16 +729,16 @@ internal PoliciesOperations(DevTestLabsClient 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 @@ -705,25 +747,29 @@ internal PoliciesOperations(DevTestLabsClient 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 policy. /// @@ -742,10 +788,10 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -754,82 +800,95 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string policySetName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string policySetName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (policySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policySetName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("policySetName", policySetName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{policySetName}", System.Uri.EscapeDataString(policySetName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -841,55 +900,56 @@ internal PoliciesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -899,20 +959,25 @@ internal PoliciesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Modify properties of policies. /// @@ -934,13 +999,13 @@ internal PoliciesOperations(DevTestLabsClient 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 /// /// @@ -949,87 +1014,100 @@ internal PoliciesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string policySetName, string name, PolicyFragment policy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string policySetName, string name, PolicyFragment policy, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (policy == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policy"); + } + 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (policySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "policySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "policySetName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - if (policy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "policy"); - } - 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("labName", labName); tracingParameters.Add("policySetName", policySetName); tracingParameters.Add("name", name); + tracingParameters.Add("policy", policy); + 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{policySetName}", System.Uri.EscapeDataString(policySetName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1041,61 +1119,62 @@ internal PoliciesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(policy != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(policy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(policy, 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); } + 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) @@ -1105,9 +1184,10 @@ internal PoliciesOperations(DevTestLabsClient 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(); @@ -1118,25 +1198,29 @@ internal PoliciesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List policies in a given policy set. /// @@ -1149,13 +1233,13 @@ internal PoliciesOperations(DevTestLabsClient 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 /// /// @@ -1164,51 +1248,54 @@ internal PoliciesOperations(DevTestLabsClient 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) @@ -1220,55 +1307,56 @@ internal PoliciesOperations(DevTestLabsClient 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); } + 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) @@ -1278,9 +1366,10 @@ internal PoliciesOperations(DevTestLabsClient 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(); @@ -1291,24 +1380,28 @@ internal PoliciesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperationsExtensions.cs index 63c1bde0da21..aecc58316be9 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperationsExtensions.cs @@ -1,305 +1,277 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PoliciesOperations. + /// Extension methods for PoliciesOperations /// public static partial class PoliciesOperationsExtensions { - /// - /// List policies in a given policy set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IPoliciesOperations operations, string labName, string policySetName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, policySetName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List policies in a given policy set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPoliciesOperations operations, string labName, string policySetName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, policySetName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List policies in a given policy set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + public static Microsoft.Rest.Azure.IPage List(this IPoliciesOperations operations, string labName, string policySetName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IPoliciesOperations)operations).ListAsync(labName, policySetName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// - public static Policy Get(this IPoliciesOperations operations, string labName, string policySetName, string name, string expand = default(string)) + /// + /// List policies in a given policy set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPoliciesOperations operations, string labName, string policySetName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, policySetName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, policySetName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + /// + /// Specify the $expand query. Example: 'properties($select=description)' + /// + public static Policy Get(this IPoliciesOperations operations, string labName, string policySetName, string name, string expand = default(string)) + { + return ((IPoliciesOperations)operations).GetAsync(labName, policySetName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// Specify the $expand query. Example: 'properties($select=description)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + /// + /// Specify the $expand query. Example: 'properties($select=description)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, policySetName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, policySetName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or replace an existing policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + public static Policy CreateOrUpdate(this IPoliciesOperations operations, string labName, string policySetName, string name, Policy policy) + { + return ((IPoliciesOperations)operations).CreateOrUpdateAsync(labName, policySetName, name, policy).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// A Policy. - /// - public static Policy CreateOrUpdate(this IPoliciesOperations operations, string labName, string policySetName, string name, Policy policy) + /// + /// Create or replace an existing policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, Policy policy, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, policySetName, name, policy, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, policySetName, name, policy).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + public static void Delete(this IPoliciesOperations operations, string labName, string policySetName, string name) + { + ((IPoliciesOperations)operations).DeleteAsync(labName, policySetName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// A Policy. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, Policy policy, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, policySetName, name, policy, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - public static void Delete(this IPoliciesOperations operations, string labName, string policySetName, string name) - { - operations.DeleteAsync(labName, policySetName, name).GetAwaiter().GetResult(); - } + /// + /// Delete policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, policySetName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + public static Policy Update(this IPoliciesOperations operations, string labName, string policySetName, string name, PolicyFragment policy) + { + return ((IPoliciesOperations)operations).UpdateAsync(labName, policySetName, name, policy).GetAwaiter().GetResult(); + } - /// - /// Delete policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The name of the policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, PolicyFragment policy, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, policySetName, name, policy, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, policySetName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// List policies in a given policy set. + /// + /// + /// 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 IPoliciesOperations operations, string nextPageLink) + { + return ((IPoliciesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Modify properties of policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// A Policy. - /// - public static Policy Update(this IPoliciesOperations operations, string labName, string policySetName, string name, PolicyFragment policy) + /// + /// List policies in a given policy set. + /// + /// + /// 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 IPoliciesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(labName, policySetName, name, policy).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Modify properties of policies. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// The name of the policy. - /// - /// - /// A Policy. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IPoliciesOperations operations, string labName, string policySetName, string name, PolicyFragment policy, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, policySetName, name, policy, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List policies in a given policy set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPoliciesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List policies in a given policy set. - /// - /// - /// 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 IPoliciesOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperations.cs index f6f87d9f07c6..7ea694dea180 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperations.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.DevTestLabs { + 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; /// /// PolicySetsOperations operations. /// - internal partial class PolicySetsOperations : IServiceOperations, IPolicySetsOperations + internal partial class PolicySetsOperations : Microsoft.Rest.IServiceOperations, IPolicySetsOperations { /// /// Initializes a new instance of the PolicySetsOperations class. @@ -36,13 +24,13 @@ internal partial class PolicySetsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PolicySetsOperations(DevTestLabsClient client) + internal PolicySetsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal PolicySetsOperations(DevTestLabsClient 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,81 +71,94 @@ internal PolicySetsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> EvaluatePoliciesWithHttpMessagesAsync(string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> EvaluatePoliciesWithHttpMessagesAsync(string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (evaluatePoliciesRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "evaluatePoliciesRequest"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (evaluatePoliciesRequest == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "evaluatePoliciesRequest"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("evaluatePoliciesRequest", evaluatePoliciesRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "EvaluatePolicies", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "EvaluatePolicies", 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.DevTestLab/labs/{labName}/policysets/{name}/evaluatePolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -169,61 +170,62 @@ internal PolicySetsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(evaluatePoliciesRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(evaluatePoliciesRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(evaluatePoliciesRequest, 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); } + 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) @@ -233,9 +235,10 @@ internal PolicySetsOperations(DevTestLabsClient 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(); @@ -246,24 +249,28 @@ internal PolicySetsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperationsExtensions.cs index 28e99c588e53..fefddc56c986 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperationsExtensions.cs @@ -1,71 +1,55 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PolicySetsOperations. + /// Extension methods for PolicySetsOperations /// public static partial class PolicySetsOperationsExtensions { - /// - /// Evaluates lab policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// Request body for evaluating a policy set. - /// - public static EvaluatePoliciesResponse EvaluatePolicies(this IPolicySetsOperations operations, string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest) - { - return operations.EvaluatePoliciesAsync(labName, name, evaluatePoliciesRequest).GetAwaiter().GetResult(); - } + /// + /// Evaluates lab policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + public static EvaluatePoliciesResponse EvaluatePolicies(this IPolicySetsOperations operations, string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest) + { + return ((IPolicySetsOperations)operations).EvaluatePoliciesAsync(labName, name, evaluatePoliciesRequest).GetAwaiter().GetResult(); + } - /// - /// Evaluates lab policy. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the policy set. - /// - /// - /// Request body for evaluating a policy set. - /// - /// - /// The cancellation token. - /// - public static async Task EvaluatePoliciesAsync(this IPolicySetsOperations operations, string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Evaluates lab policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the policy set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task EvaluatePoliciesAsync(this IPolicySetsOperations operations, string labName, string name, EvaluatePoliciesRequest evaluatePoliciesRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.EvaluatePoliciesWithHttpMessagesAsync(labName, name, evaluatePoliciesRequest, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.EvaluatePoliciesWithHttpMessagesAsync(labName, name, evaluatePoliciesRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperations.cs index c176c9e44add..dc756db7f657 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperations.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.DevTestLabs { + 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; /// /// ProviderOperations operations. /// - internal partial class ProviderOperations : IServiceOperations, IProviderOperations + internal partial class ProviderOperations : Microsoft.Rest.IServiceOperations, IProviderOperations { /// /// Initializes a new instance of the ProviderOperations class. @@ -36,13 +24,13 @@ internal partial class ProviderOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ProviderOperations(DevTestLabsClient client) + internal ProviderOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal ProviderOperations(DevTestLabsClient 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 ProviderOperations(DevTestLabsClient 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.DevTestLab/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,55 +129,56 @@ internal ProviderOperations(DevTestLabsClient 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); } + 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) @@ -191,9 +188,10 @@ internal ProviderOperations(DevTestLabsClient 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(); @@ -204,25 +202,29 @@ internal ProviderOperations(DevTestLabsClient 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; - } + + + + + } /// /// Result of the request to list REST API operations /// @@ -235,13 +237,13 @@ internal ProviderOperations(DevTestLabsClient 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 /// /// @@ -250,51 +252,54 @@ internal ProviderOperations(DevTestLabsClient 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) @@ -306,55 +311,56 @@ internal ProviderOperations(DevTestLabsClient 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); } + 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) @@ -364,9 +370,10 @@ internal ProviderOperations(DevTestLabsClient 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(); @@ -377,24 +384,28 @@ internal ProviderOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperationsExtensions.cs index 28ef5bf7374d..0a70971db733 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperationsExtensions.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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ProviderOperations. + /// Extension methods for ProviderOperations /// public static partial class ProviderOperationsExtensions { - /// - /// Result of the request to list REST API operations - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IProviderOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Result of the request to list REST API operations + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IProviderOperations operations) + { + return ((IProviderOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Result of the request to list REST API operations - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IProviderOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Result of the request to list REST API operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IProviderOperations 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; } + } + /// + /// Result of the request to list 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 IProviderOperations operations, string nextPageLink) + { + return ((IProviderOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Result of the request to list 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 IProviderOperations operations, string nextPageLink) + /// + /// Result of the request to list 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 IProviderOperations 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; } - - /// - /// Result of the request to list 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 IProviderOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperations.cs index 68eb07a7fb9c..5ad54ac2202e 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// SchedulesOperations operations. /// - internal partial class SchedulesOperations : IServiceOperations, ISchedulesOperations + internal partial class SchedulesOperations : Microsoft.Rest.IServiceOperations, ISchedulesOperations { /// /// Initializes a new instance of the SchedulesOperations class. @@ -37,13 +24,13 @@ internal partial class SchedulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SchedulesOperations(DevTestLabsClient client) + internal SchedulesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// List schedules in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/schedules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _schedule = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_schedule)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_schedule); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal SchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get schedule. /// @@ -265,7 +270,7 @@ internal SchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// Specify the $expand query. Example: 'properties($select=status)' + /// Specify the $expand query. Example: 'properties($select=status)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal SchedulesOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal SchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing schedule. /// @@ -482,13 +506,13 @@ internal SchedulesOperations(DevTestLabsClient 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 /// /// @@ -497,81 +521,94 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Schedule schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, Schedule schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (schedule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "schedule"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (schedule == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("schedule", schedule); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -583,61 +620,62 @@ internal SchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(schedule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, 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); } + 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) @@ -647,9 +685,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -660,16 +699,16 @@ internal SchedulesOperations(DevTestLabsClient 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 @@ -678,25 +717,29 @@ internal SchedulesOperations(DevTestLabsClient 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 schedule. /// @@ -712,10 +755,10 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -724,76 +767,88 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -805,55 +860,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -863,20 +919,25 @@ internal SchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Modify properties of schedules. /// @@ -895,13 +956,13 @@ internal SchedulesOperations(DevTestLabsClient 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 /// /// @@ -910,81 +971,93 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string name, ScheduleFragment schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, ScheduleFragment schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (schedule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "schedule"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (schedule == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("schedule", schedule); + 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.DevTestLab/labs/{labName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -996,61 +1069,62 @@ internal SchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(schedule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, 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); } + 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) @@ -1060,9 +1134,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -1073,25 +1148,29 @@ internal SchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Execute a schedule. This operation can take a while to complete. /// @@ -1102,16 +1181,16 @@ internal SchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ExecuteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ExecuteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1129,13 +1208,13 @@ internal SchedulesOperations(DevTestLabsClient 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 /// /// @@ -1144,76 +1223,88 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListApplicableWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListApplicableWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListApplicable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListApplicable", 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.DevTestLab/labs/{labName}/schedules/{name}/listApplicable").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1225,55 +1316,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1283,9 +1375,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -1296,25 +1389,29 @@ internal SchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Execute a schedule. This operation can take a while to complete. /// @@ -1330,10 +1427,10 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1342,76 +1439,88 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginExecuteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginExecuteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", 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.DevTestLab/labs/{labName}/schedules/{name}/execute").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1423,55 +1532,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1481,20 +1591,25 @@ internal SchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List schedules in a given lab. /// @@ -1507,13 +1622,13 @@ internal SchedulesOperations(DevTestLabsClient 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 /// /// @@ -1522,51 +1637,54 @@ internal SchedulesOperations(DevTestLabsClient 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) @@ -1578,55 +1696,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1636,9 +1755,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -1649,25 +1769,29 @@ internal SchedulesOperations(DevTestLabsClient 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 applicable schedules /// @@ -1680,13 +1804,13 @@ internal SchedulesOperations(DevTestLabsClient 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 /// /// @@ -1695,51 +1819,54 @@ internal SchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListApplicableNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListApplicableNextWithHttpMessagesAsync(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, "ListApplicableNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListApplicableNext", 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("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) @@ -1751,55 +1878,56 @@ internal SchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1809,9 +1937,10 @@ internal SchedulesOperations(DevTestLabsClient 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(); @@ -1822,24 +1951,28 @@ internal SchedulesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperationsExtensions.cs index 88ceac2ea83c..15a2117f1275 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperationsExtensions.cs @@ -1,423 +1,391 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SchedulesOperations. + /// Extension methods for SchedulesOperations /// public static partial class SchedulesOperationsExtensions { - /// - /// List schedules in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this ISchedulesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } + /// + /// List schedules in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this ISchedulesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((ISchedulesOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// List schedules in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISchedulesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List schedules in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISchedulesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// Specify the $expand query. Example: 'properties($select=status)' + /// + public static Schedule Get(this ISchedulesOperations operations, string labName, string name, string expand = default(string)) + { + return ((ISchedulesOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this ISchedulesOperations operations, string labName, string name, string expand = default(string)) + /// + /// Get schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// Specify the $expand query. Example: 'properties($select=status)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISchedulesOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + public static Schedule CreateOrUpdate(this ISchedulesOperations operations, string labName, string name, Schedule schedule) + { + return ((ISchedulesOperations)operations).CreateOrUpdateAsync(labName, name, schedule).GetAwaiter().GetResult(); + } - /// - /// Get schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISchedulesOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISchedulesOperations operations, string labName, string name, Schedule schedule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, schedule, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + public static void Delete(this ISchedulesOperations operations, string labName, string name) + { + ((ISchedulesOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - public static Schedule CreateOrUpdate(this ISchedulesOperations operations, string labName, string name, Schedule schedule) - { - return operations.CreateOrUpdateAsync(labName, name, schedule).GetAwaiter().GetResult(); - } + /// + /// Delete schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISchedulesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of schedules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + public static Schedule Update(this ISchedulesOperations operations, string labName, string name, ScheduleFragment schedule) + { + return ((ISchedulesOperations)operations).UpdateAsync(labName, name, schedule).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISchedulesOperations operations, string labName, string name, Schedule schedule, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of schedules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ISchedulesOperations operations, string labName, string name, ScheduleFragment schedule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, schedule, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, schedule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + public static void Execute(this ISchedulesOperations operations, string labName, string name) + { + ((ISchedulesOperations)operations).ExecuteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Delete schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - public static void Delete(this ISchedulesOperations operations, string labName, string name) - { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); - } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExecuteAsync(this ISchedulesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ExecuteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all applicable schedules + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + public static Microsoft.Rest.Azure.IPage ListApplicable(this ISchedulesOperations operations, string labName, string name) + { + return ((ISchedulesOperations)operations).ListApplicableAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Delete schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISchedulesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all applicable schedules + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListApplicableAsync(this ISchedulesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListApplicableWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + public static void BeginExecute(this ISchedulesOperations operations, string labName, string name) + { + ((ISchedulesOperations)operations).BeginExecuteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Modify properties of schedules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - public static Schedule Update(this ISchedulesOperations operations, string labName, string name, ScheduleFragment schedule) - { - return operations.UpdateAsync(labName, name, schedule).GetAwaiter().GetResult(); - } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExecuteAsync(this ISchedulesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginExecuteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List schedules in a given lab. + /// + /// + /// 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 ISchedulesOperations operations, string nextPageLink) + { + return ((ISchedulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Modify properties of schedules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ISchedulesOperations operations, string labName, string name, ScheduleFragment schedule, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List schedules in a given lab. + /// + /// + /// 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 ISchedulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, schedule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all applicable schedules + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListApplicableNext(this ISchedulesOperations operations, string nextPageLink) + { + return ((ISchedulesOperations)operations).ListApplicableNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - public static void Execute(this ISchedulesOperations operations, string labName, string name) + /// + /// Lists all applicable schedules + /// + /// + /// 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> ListApplicableNextAsync(this ISchedulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListApplicableNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.ExecuteAsync(labName, name).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task ExecuteAsync(this ISchedulesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ExecuteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all applicable schedules - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - public static IPage ListApplicable(this ISchedulesOperations operations, string labName, string name) - { - return operations.ListApplicableAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Lists all applicable schedules - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task> ListApplicableAsync(this ISchedulesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListApplicableWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - public static void BeginExecute(this ISchedulesOperations operations, string labName, string name) - { - operations.BeginExecuteAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginExecuteAsync(this ISchedulesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginExecuteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List schedules in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISchedulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a given lab. - /// - /// - /// 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 ISchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all applicable schedules - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListApplicableNext(this ISchedulesOperations operations, string nextPageLink) - { - return operations.ListApplicableNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all applicable schedules - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListApplicableNextAsync(this ISchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListApplicableNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SdkInfo_DevTestLabsClient.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SdkInfo_DevTestLabsClient.cs deleted file mode 100644 index 5055a941c9c3..000000000000 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SdkInfo_DevTestLabsClient.cs +++ /dev/null @@ -1,49 +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.DevTestLabs -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_DevTestLabsClient - { - get - { - return new Tuple[] - { - new Tuple("DevTestLab", "ArmTemplates", "2016-05-15"), - new Tuple("DevTestLab", "ArtifactSources", "2016-05-15"), - new Tuple("DevTestLab", "Artifacts", "2016-05-15"), - new Tuple("DevTestLab", "Costs", "2016-05-15"), - new Tuple("DevTestLab", "CustomImages", "2016-05-15"), - new Tuple("DevTestLab", "Disks", "2016-05-15"), - new Tuple("DevTestLab", "Environments", "2016-05-15"), - new Tuple("DevTestLab", "Formulas", "2016-05-15"), - new Tuple("DevTestLab", "GalleryImages", "2016-05-15"), - new Tuple("DevTestLab", "GlobalSchedules", "2016-05-15"), - new Tuple("DevTestLab", "Labs", "2016-05-15"), - new Tuple("DevTestLab", "NotificationChannels", "2016-05-15"), - new Tuple("DevTestLab", "Operations", "2016-05-15"), - new Tuple("DevTestLab", "Policies", "2016-05-15"), - new Tuple("DevTestLab", "PolicySets", "2016-05-15"), - new Tuple("DevTestLab", "ProviderOperations", "2016-05-15"), - new Tuple("DevTestLab", "Schedules", "2016-05-15"), - new Tuple("DevTestLab", "Secrets", "2016-05-15"), - new Tuple("DevTestLab", "ServiceRunners", "2016-05-15"), - new Tuple("DevTestLab", "Users", "2016-05-15"), - new Tuple("DevTestLab", "VirtualMachineSchedules", "2016-05-15"), - new Tuple("DevTestLab", "VirtualMachines", "2016-05-15"), - new Tuple("DevTestLab", "VirtualNetworks", "2016-05-15"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperations.cs index aeb99cd36e7c..1c4eb72b7812 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// SecretsOperations operations. /// - internal partial class SecretsOperations : IServiceOperations, ISecretsOperations + internal partial class SecretsOperations : Microsoft.Rest.IServiceOperations, ISecretsOperations { /// /// Initializes a new instance of the SecretsOperations class. @@ -37,13 +24,13 @@ internal partial class SecretsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal SecretsOperations(DevTestLabsClient client) + internal SecretsOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal SecretsOperations(DevTestLabsClient client) /// /// List secrets in a given user profile. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the user profile. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal SecretsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("userName", userName); + + 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.DevTestLab/labs/{labName}/users/{userName}/secrets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _secret = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_secret)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_secret); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal SecretsOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal SecretsOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal SecretsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get secret. /// @@ -277,7 +283,7 @@ internal SecretsOperations(DevTestLabsClient client) /// The name of the secret. /// /// - /// Specify the $expand query. Example: 'properties($select=value)' + /// Specify the $expand query. Example: 'properties($select=value)' /// /// /// Headers that will be added to request. @@ -285,13 +291,13 @@ internal SecretsOperations(DevTestLabsClient 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 /// /// @@ -300,87 +306,101 @@ internal SecretsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string userName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -392,55 +412,56 @@ internal SecretsOperations(DevTestLabsClient 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); } + 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) @@ -450,9 +471,10 @@ internal SecretsOperations(DevTestLabsClient 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(); @@ -463,25 +485,29 @@ internal SecretsOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing secret. /// @@ -503,13 +529,13 @@ internal SecretsOperations(DevTestLabsClient 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 /// /// @@ -518,87 +544,101 @@ internal SecretsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Secret secret, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string userName, string name, Secret secret, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (secret == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "secret"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + if (this.Client.ResourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - if (secret == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "secret"); - } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + tracingParameters.Add("secret", secret); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -610,61 +650,62 @@ internal SecretsOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(secret != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(secret, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(secret, 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); } + 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) @@ -674,9 +715,10 @@ internal SecretsOperations(DevTestLabsClient 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(); @@ -687,16 +729,16 @@ internal SecretsOperations(DevTestLabsClient 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 @@ -705,25 +747,29 @@ internal SecretsOperations(DevTestLabsClient 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 secret. /// @@ -742,10 +788,10 @@ internal SecretsOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -754,82 +800,95 @@ internal SecretsOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string userName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (userName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "userName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("userName", userName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -841,55 +900,56 @@ internal SecretsOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -899,20 +959,25 @@ internal SecretsOperations(DevTestLabsClient 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; - } + + + + + } /// /// List secrets in a given user profile. /// @@ -925,13 +990,13 @@ internal SecretsOperations(DevTestLabsClient 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 /// /// @@ -940,51 +1005,54 @@ internal SecretsOperations(DevTestLabsClient 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) @@ -996,55 +1064,56 @@ internal SecretsOperations(DevTestLabsClient 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); } + 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) @@ -1054,9 +1123,10 @@ internal SecretsOperations(DevTestLabsClient 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(); @@ -1067,24 +1137,28 @@ internal SecretsOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperationsExtensions.cs index 1f4208e9e918..9f852b82932d 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperationsExtensions.cs @@ -1,253 +1,232 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SecretsOperations. + /// Extension methods for SecretsOperations /// public static partial class SecretsOperationsExtensions { - /// - /// List secrets in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this ISecretsOperations operations, string labName, string userName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, userName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List secrets in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISecretsOperations operations, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get secret. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the secret. - /// - /// - /// Specify the $expand query. Example: 'properties($select=value)' - /// - public static Secret Get(this ISecretsOperations operations, string labName, string userName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, userName, name, expand).GetAwaiter().GetResult(); - } + /// + /// List secrets in a given user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static Microsoft.Rest.Azure.IPage List(this ISecretsOperations operations, string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((ISecretsOperations)operations).ListAsync(labName, userName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get secret. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the secret. - /// - /// - /// Specify the $expand query. Example: 'properties($select=value)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISecretsOperations operations, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List secrets in a given user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISecretsOperations operations, string labName, string userName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the secret. + /// + /// + /// Specify the $expand query. Example: 'properties($select=value)' + /// + public static Secret Get(this ISecretsOperations operations, string labName, string userName, string name, string expand = default(string)) + { + return ((ISecretsOperations)operations).GetAsync(labName, userName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing secret. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the secret. - /// - /// - /// A secret. - /// - public static Secret CreateOrUpdate(this ISecretsOperations operations, string labName, string userName, string name, Secret secret) + /// + /// Get secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the secret. + /// + /// + /// Specify the $expand query. Example: 'properties($select=value)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISecretsOperations operations, string labName, string userName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, userName, name, secret).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the secret. + /// + public static Secret CreateOrUpdate(this ISecretsOperations operations, string labName, string userName, string name, Secret secret) + { + return ((ISecretsOperations)operations).CreateOrUpdateAsync(labName, userName, name, secret).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing secret. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the secret. - /// - /// - /// A secret. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISecretsOperations operations, string labName, string userName, string name, Secret secret, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the secret. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISecretsOperations operations, string labName, string userName, string name, Secret secret, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, userName, name, secret, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, userName, name, secret, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the secret. + /// + public static void Delete(this ISecretsOperations operations, string labName, string userName, string name) + { + ((ISecretsOperations)operations).DeleteAsync(labName, userName, name).GetAwaiter().GetResult(); + } - /// - /// Delete secret. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the secret. - /// - public static void Delete(this ISecretsOperations operations, string labName, string userName, string name) - { - operations.DeleteAsync(labName, userName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete secret. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The name of the secret. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISecretsOperations operations, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete secret. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The name of the secret. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISecretsOperations operations, string labName, string userName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, userName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List secrets in a given user profile. + /// + /// + /// 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 ISecretsOperations operations, string nextPageLink) + { + return ((ISecretsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List secrets in a given user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISecretsOperations operations, string nextPageLink) + /// + /// List secrets in a given user profile. + /// + /// + /// 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 ISecretsOperations 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; } - - /// - /// List secrets in a given user profile. - /// - /// - /// 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 ISecretsOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperations.cs index 4c9d86d77c66..5ddcbdf568d6 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// ServiceRunnersOperations operations. /// - internal partial class ServiceRunnersOperations : IServiceOperations, IServiceRunnersOperations + internal partial class ServiceRunnersOperations : Microsoft.Rest.IServiceOperations, IServiceRunnersOperations { /// /// Initializes a new instance of the ServiceRunnersOperations class. @@ -37,13 +24,13 @@ internal partial class ServiceRunnersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ServiceRunnersOperations(DevTestLabsClient client) + internal ServiceRunnersOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// List service runners in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/servicerunners").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _serviceRunner = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_serviceRunner)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_serviceRunner); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal ServiceRunnersOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal ServiceRunnersOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal ServiceRunnersOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get service runner. /// @@ -270,13 +275,13 @@ internal ServiceRunnersOperations(DevTestLabsClient 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 /// /// @@ -285,76 +290,88 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/servicerunners/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -366,55 +383,56 @@ internal ServiceRunnersOperations(DevTestLabsClient 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); } + 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) @@ -424,9 +442,10 @@ internal ServiceRunnersOperations(DevTestLabsClient 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(); @@ -437,25 +456,29 @@ internal ServiceRunnersOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing Service runner. /// @@ -474,13 +497,13 @@ internal ServiceRunnersOperations(DevTestLabsClient 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 /// /// @@ -489,81 +512,94 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ServiceRunner serviceRunner, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, ServiceRunner serviceRunner, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (serviceRunner == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "serviceRunner"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (serviceRunner == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "serviceRunner"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("serviceRunner", serviceRunner); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/servicerunners/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -575,61 +611,62 @@ internal ServiceRunnersOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(serviceRunner != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(serviceRunner, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(serviceRunner, 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); } + 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) @@ -639,9 +676,10 @@ internal ServiceRunnersOperations(DevTestLabsClient 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(); @@ -652,16 +690,16 @@ internal ServiceRunnersOperations(DevTestLabsClient 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 @@ -670,25 +708,29 @@ internal ServiceRunnersOperations(DevTestLabsClient 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 service runner. /// @@ -704,10 +746,10 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -716,76 +758,88 @@ internal ServiceRunnersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/servicerunners/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -797,55 +851,56 @@ internal ServiceRunnersOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -855,20 +910,25 @@ internal ServiceRunnersOperations(DevTestLabsClient 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; - } + + + + + } /// /// List service runners in a given lab. /// @@ -881,13 +941,13 @@ internal ServiceRunnersOperations(DevTestLabsClient 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 /// /// @@ -896,51 +956,54 @@ internal ServiceRunnersOperations(DevTestLabsClient 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) @@ -952,55 +1015,56 @@ internal ServiceRunnersOperations(DevTestLabsClient 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); } + 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) @@ -1010,9 +1074,10 @@ internal ServiceRunnersOperations(DevTestLabsClient 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(); @@ -1023,24 +1088,28 @@ internal ServiceRunnersOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperationsExtensions.cs index ce5de9e0f812..547f4aa3fac8 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperationsExtensions.cs @@ -1,223 +1,202 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ServiceRunnersOperations. + /// Extension methods for ServiceRunnersOperations /// public static partial class ServiceRunnersOperationsExtensions { - /// - /// List service runners in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IServiceRunnersOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List service runners in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IServiceRunnersOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get service runner. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the service runner. - /// - public static ServiceRunner Get(this IServiceRunnersOperations operations, string labName, string name) - { - return operations.GetAsync(labName, name).GetAwaiter().GetResult(); - } + /// + /// List service runners in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IServiceRunnersOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IServiceRunnersOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get service runner. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the service runner. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IServiceRunnersOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List service runners in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IServiceRunnersOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get service runner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + public static ServiceRunner Get(this IServiceRunnersOperations operations, string labName, string name) + { + return ((IServiceRunnersOperations)operations).GetAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing Service runner. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the service runner. - /// - /// - /// A container for a managed identity to execute DevTest lab services. - /// - public static ServiceRunner CreateOrUpdate(this IServiceRunnersOperations operations, string labName, string name, ServiceRunner serviceRunner) + /// + /// Get service runner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IServiceRunnersOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, name, serviceRunner).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing Service runner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + public static ServiceRunner CreateOrUpdate(this IServiceRunnersOperations operations, string labName, string name, ServiceRunner serviceRunner) + { + return ((IServiceRunnersOperations)operations).CreateOrUpdateAsync(labName, name, serviceRunner).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing Service runner. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the service runner. - /// - /// - /// A container for a managed identity to execute DevTest lab services. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IServiceRunnersOperations operations, string labName, string name, ServiceRunner serviceRunner, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing Service runner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceRunnersOperations operations, string labName, string name, ServiceRunner serviceRunner, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, serviceRunner, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, serviceRunner, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete service runner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + public static void Delete(this IServiceRunnersOperations operations, string labName, string name) + { + ((IServiceRunnersOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Delete service runner. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the service runner. - /// - public static void Delete(this IServiceRunnersOperations operations, string labName, string name) - { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete service runner. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the service runner. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IServiceRunnersOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete service runner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the service runner. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IServiceRunnersOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List service runners in a given lab. + /// + /// + /// 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 IServiceRunnersOperations operations, string nextPageLink) + { + return ((IServiceRunnersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List service runners in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IServiceRunnersOperations operations, string nextPageLink) + /// + /// List service runners in a given lab. + /// + /// + /// 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 IServiceRunnersOperations 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; } - - /// - /// List service runners in a given lab. - /// - /// - /// 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 IServiceRunnersOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperations.cs index 62821da17e3c..4f397d4ccc84 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// UsersOperations operations. /// - internal partial class UsersOperations : IServiceOperations, IUsersOperations + internal partial class UsersOperations : Microsoft.Rest.IServiceOperations, IUsersOperations { /// /// Initializes a new instance of the UsersOperations class. @@ -37,13 +24,13 @@ internal partial class UsersOperations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal UsersOperations(DevTestLabsClient client) + internal UsersOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal UsersOperations(DevTestLabsClient client) /// /// List user profiles in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal UsersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/users").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _user = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_user)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_user); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal UsersOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal UsersOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal UsersOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get user profile. /// @@ -265,7 +270,7 @@ internal UsersOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// Specify the $expand query. Example: 'properties($select=identity)' + /// Specify the $expand query. Example: 'properties($select=identity)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal UsersOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal UsersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/users/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal UsersOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal UsersOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal UsersOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing user profile. /// @@ -482,13 +506,13 @@ internal UsersOperations(DevTestLabsClient 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 /// /// @@ -497,81 +521,94 @@ internal UsersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, User user, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, User user, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (user == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "user"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (user == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "user"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("user", user); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/users/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -583,61 +620,62 @@ internal UsersOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(user != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(user, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(user, 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); } + 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) @@ -647,9 +685,10 @@ internal UsersOperations(DevTestLabsClient 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(); @@ -660,16 +699,16 @@ internal UsersOperations(DevTestLabsClient 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 @@ -678,25 +717,29 @@ internal UsersOperations(DevTestLabsClient 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 user profile. This operation can take a while to complete. /// @@ -707,16 +750,16 @@ internal UsersOperations(DevTestLabsClient client) /// The name of the user profile. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -737,13 +780,13 @@ internal UsersOperations(DevTestLabsClient 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 /// /// @@ -752,81 +795,93 @@ internal UsersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string name, UserFragment user, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, UserFragment user, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (user == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "user"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (user == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "user"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("user", user); + 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.DevTestLab/labs/{labName}/users/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -838,61 +893,62 @@ internal UsersOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(user != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(user, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(user, 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); } + 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) @@ -902,9 +958,10 @@ internal UsersOperations(DevTestLabsClient 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(); @@ -915,25 +972,29 @@ internal UsersOperations(DevTestLabsClient 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 user profile. This operation can take a while to complete. /// @@ -949,10 +1010,10 @@ internal UsersOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -961,76 +1022,88 @@ internal UsersOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + 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.DevTestLab/labs/{labName}/users/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1042,55 +1115,56 @@ internal UsersOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -1100,20 +1174,25 @@ internal UsersOperations(DevTestLabsClient 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; - } + + + + + } /// /// List user profiles in a given lab. /// @@ -1126,13 +1205,13 @@ internal UsersOperations(DevTestLabsClient 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 /// /// @@ -1141,51 +1220,54 @@ internal UsersOperations(DevTestLabsClient 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) @@ -1197,55 +1279,56 @@ internal UsersOperations(DevTestLabsClient 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); } + 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) @@ -1255,9 +1338,10 @@ internal UsersOperations(DevTestLabsClient 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(); @@ -1268,24 +1352,28 @@ internal UsersOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperationsExtensions.cs index 1e378fdd80b9..50413a9f69b1 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperationsExtensions.cs @@ -1,312 +1,283 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for UsersOperations. + /// Extension methods for UsersOperations /// public static partial class UsersOperationsExtensions { - /// - /// List user profiles in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IUsersOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List user profiles in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IUsersOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// Specify the $expand query. Example: 'properties($select=identity)' - /// - public static User Get(this IUsersOperations operations, string labName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// Specify the $expand query. Example: 'properties($select=identity)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IUsersOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// Profile of a lab user. - /// - public static User CreateOrUpdate(this IUsersOperations operations, string labName, string name, User user) - { - return operations.CreateOrUpdateAsync(labName, name, user).GetAwaiter().GetResult(); - } + /// + /// List user profiles in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IUsersOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IUsersOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing user profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// Profile of a lab user. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IUsersOperations operations, string labName, string name, User user, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List user profiles in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IUsersOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, user, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// Specify the $expand query. Example: 'properties($select=identity)' + /// + public static User Get(this IUsersOperations operations, string labName, string name, string expand = default(string)) + { + return ((IUsersOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Delete user profile. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - public static void Delete(this IUsersOperations operations, string labName, string name) + /// + /// Get user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// Specify the $expand query. Example: 'properties($select=identity)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IUsersOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static User CreateOrUpdate(this IUsersOperations operations, string labName, string name, User user) + { + return ((IUsersOperations)operations).CreateOrUpdateAsync(labName, name, user).GetAwaiter().GetResult(); + } - /// - /// Delete user profile. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IUsersOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing user profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IUsersOperations operations, string labName, string name, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, user, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete user profile. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static void Delete(this IUsersOperations operations, string labName, string name) + { + ((IUsersOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Modify properties of user profiles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// Profile of a lab user. - /// - public static User Update(this IUsersOperations operations, string labName, string name, UserFragment user) - { - return operations.UpdateAsync(labName, name, user).GetAwaiter().GetResult(); - } + /// + /// Delete user profile. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IUsersOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of user profiles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static User Update(this IUsersOperations operations, string labName, string name, UserFragment user) + { + return ((IUsersOperations)operations).UpdateAsync(labName, name, user).GetAwaiter().GetResult(); + } - /// - /// Modify properties of user profiles. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// Profile of a lab user. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IUsersOperations operations, string labName, string name, UserFragment user, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of user profiles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IUsersOperations operations, string labName, string name, UserFragment user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, user, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, user, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete user profile. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + public static void BeginDelete(this IUsersOperations operations, string labName, string name) + { + ((IUsersOperations)operations).BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Delete user profile. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - public static void BeginDelete(this IUsersOperations operations, string labName, string name) - { - operations.BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); - } + /// + /// Delete user profile. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the user profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IUsersOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List user profiles in a given lab. + /// + /// + /// 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 IUsersOperations operations, string nextPageLink) + { + return ((IUsersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete user profile. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the user profile. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IUsersOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List user profiles in a given lab. + /// + /// + /// 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 IUsersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// List user profiles in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IUsersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List user profiles in a given lab. - /// - /// - /// 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 IUsersOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperations.cs index bc8a484b70a2..ed07f41c89df 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// VirtualMachineSchedulesOperations operations. /// - internal partial class VirtualMachineSchedulesOperations : IServiceOperations, IVirtualMachineSchedulesOperations + internal partial class VirtualMachineSchedulesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineSchedulesOperations { /// /// Initializes a new instance of the VirtualMachineSchedulesOperations class. @@ -37,13 +24,13 @@ internal partial class VirtualMachineSchedulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachineSchedulesOperations(DevTestLabsClient client) + internal VirtualMachineSchedulesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,28 +41,28 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// List schedules in a given virtual machine. /// + /// + /// + /// /// /// The name of the lab. /// /// /// The name of the virtual machine. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -84,85 +71,98 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, string virtualMachineName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, string virtualMachineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (virtualMachineName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); + + 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _schedule = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_schedule)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_schedule); } } - if (Client.ApiVersion != null) + 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) @@ -174,55 +174,56 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -232,9 +233,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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(); @@ -245,25 +247,29 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get schedule. /// @@ -277,7 +283,7 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// Specify the $expand query. Example: 'properties($select=status)' + /// Specify the $expand query. Example: 'properties($select=status)' /// /// /// Headers that will be added to request. @@ -285,13 +291,13 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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 /// /// @@ -300,87 +306,101 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string virtualMachineName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string virtualMachineName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (virtualMachineName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -392,55 +412,56 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -450,9 +471,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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(); @@ -463,25 +485,29 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing schedule. /// @@ -503,13 +529,13 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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 /// /// @@ -518,87 +544,101 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Schedule schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Schedule schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (schedule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "schedule"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + if (this.Client.ResourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (virtualMachineName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - if (schedule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); - } - 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("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); tracingParameters.Add("name", name); + tracingParameters.Add("schedule", schedule); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -610,61 +650,62 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(schedule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, 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); } + 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) @@ -674,9 +715,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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(); @@ -687,16 +729,16 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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 @@ -705,25 +747,29 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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 schedule. /// @@ -742,10 +788,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -754,82 +800,95 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (virtualMachineName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -841,55 +900,56 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (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) @@ -899,20 +959,25 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Modify properties of schedules. /// @@ -934,13 +999,13 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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 /// /// @@ -949,87 +1014,100 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, ScheduleFragment schedule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string virtualMachineName, string name, ScheduleFragment schedule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (schedule == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "schedule"); + } + 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (virtualMachineName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (schedule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schedule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); tracingParameters.Add("name", name); + tracingParameters.Add("schedule", schedule); + 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1041,61 +1119,62 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(schedule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(schedule, 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); } + 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) @@ -1105,9 +1184,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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(); @@ -1118,25 +1198,29 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Execute a schedule. This operation can take a while to complete. /// @@ -1150,16 +1234,16 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// The name of the schedule. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(labName, virtualMachineName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(labName, virtualMachineName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1180,10 +1264,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1192,82 +1276,95 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginExecuteWithHttpMessagesAsync(string labName, string virtualMachineName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (virtualMachineName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("virtualMachineName", virtualMachineName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}/execute").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{virtualMachineName}", System.Uri.EscapeDataString(virtualMachineName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1279,55 +1376,56 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1337,20 +1435,25 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List schedules in a given virtual machine. /// @@ -1363,13 +1466,13 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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 /// /// @@ -1378,51 +1481,54 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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) @@ -1434,55 +1540,56 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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); } + 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) @@ -1492,9 +1599,10 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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(); @@ -1505,24 +1613,28 @@ internal VirtualMachineSchedulesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperationsExtensions.cs index d7037f393f6a..caa120928e50 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperationsExtensions.cs @@ -1,391 +1,361 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineSchedulesOperations. + /// Extension methods for VirtualMachineSchedulesOperations /// public static partial class VirtualMachineSchedulesOperationsExtensions { - /// - /// List schedules in a given virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, virtualMachineName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a given virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, virtualMachineName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - public static Schedule Get(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, virtualMachineName, name, expand).GetAwaiter().GetResult(); - } + /// + /// List schedules in a given virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IVirtualMachineSchedulesOperations)operations).ListAsync(labName, virtualMachineName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// Get schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// Specify the $expand query. Example: 'properties($select=status)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List schedules in a given virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, virtualMachineName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, virtualMachineName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// Specify the $expand query. Example: 'properties($select=status)' + /// + public static Schedule Get(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, string expand = default(string)) + { + return ((IVirtualMachineSchedulesOperations)operations).GetAsync(labName, virtualMachineName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - public static Schedule CreateOrUpdate(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, Schedule schedule) + /// + /// Get schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// Specify the $expand query. Example: 'properties($select=status)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, virtualMachineName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(labName, virtualMachineName, name, schedule).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + public static Schedule CreateOrUpdate(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, Schedule schedule) + { + return ((IVirtualMachineSchedulesOperations)operations).CreateOrUpdateAsync(labName, virtualMachineName, name, schedule).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, Schedule schedule, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, Schedule schedule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, virtualMachineName, name, schedule, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, virtualMachineName, name, schedule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + public static void Delete(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name) + { + ((IVirtualMachineSchedulesOperations)operations).DeleteAsync(labName, virtualMachineName, name).GetAwaiter().GetResult(); + } - /// - /// Delete schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - public static void Delete(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name) - { - operations.DeleteAsync(labName, virtualMachineName, name).GetAwaiter().GetResult(); - } + /// + /// Delete schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of schedules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + public static Schedule Update(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, ScheduleFragment schedule) + { + return ((IVirtualMachineSchedulesOperations)operations).UpdateAsync(labName, virtualMachineName, name, schedule).GetAwaiter().GetResult(); + } - /// - /// Delete schedule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of schedules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, ScheduleFragment schedule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, virtualMachineName, name, schedule, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + public static void Execute(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name) + { + ((IVirtualMachineSchedulesOperations)operations).ExecuteAsync(labName, virtualMachineName, name).GetAwaiter().GetResult(); + } - /// - /// Modify properties of schedules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - public static Schedule Update(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, ScheduleFragment schedule) - { - return operations.UpdateAsync(labName, virtualMachineName, name, schedule).GetAwaiter().GetResult(); - } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExecuteAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ExecuteWithHttpMessagesAsync(labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + public static void BeginExecute(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name) + { + ((IVirtualMachineSchedulesOperations)operations).BeginExecuteAsync(labName, virtualMachineName, name).GetAwaiter().GetResult(); + } - /// - /// Modify properties of schedules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// A schedule. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, ScheduleFragment schedule, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, virtualMachineName, name, schedule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Execute a schedule. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the schedule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExecuteAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginExecuteWithHttpMessagesAsync(labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List schedules in a given virtual machine. + /// + /// + /// 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 IVirtualMachineSchedulesOperations operations, string nextPageLink) + { + return ((IVirtualMachineSchedulesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - public static void Execute(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name) + /// + /// List schedules in a given virtual machine. + /// + /// + /// 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 IVirtualMachineSchedulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.ExecuteAsync(labName, virtualMachineName, name).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task ExecuteAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ExecuteWithHttpMessagesAsync(labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - public static void BeginExecute(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name) - { - operations.BeginExecuteAsync(labName, virtualMachineName, name).GetAwaiter().GetResult(); - } - - /// - /// Execute a schedule. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the schedule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginExecuteAsync(this IVirtualMachineSchedulesOperations operations, string labName, string virtualMachineName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginExecuteWithHttpMessagesAsync(labName, virtualMachineName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List schedules in a given virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachineSchedulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List schedules in a given virtual machine. - /// - /// - /// 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 IVirtualMachineSchedulesOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperations.cs index 4b8815079797..b40892710b4a 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// VirtualMachinesOperations operations. /// - internal partial class VirtualMachinesOperations : IServiceOperations, IVirtualMachinesOperations + internal partial class VirtualMachinesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachinesOperations { /// /// Initializes a new instance of the VirtualMachinesOperations class. @@ -37,13 +24,13 @@ internal partial class VirtualMachinesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachinesOperations(DevTestLabsClient client) + internal VirtualMachinesOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// List virtual machines in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/virtualmachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _labVirtualMachine = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_labVirtualMachine)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_labVirtualMachine); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal VirtualMachinesOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get virtual machine. /// @@ -266,7 +271,7 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// /// Specify the $expand query. Example: - /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' /// /// /// Headers that will be added to request. @@ -274,13 +279,13 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 /// /// @@ -289,81 +294,94 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/virtualmachines/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -375,55 +393,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -433,9 +452,10 @@ internal VirtualMachinesOperations(DevTestLabsClient 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(); @@ -446,25 +466,29 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing Virtual machine. This operation can take a /// while to complete. @@ -479,16 +503,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// A virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -501,16 +525,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -531,13 +555,13 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 /// /// @@ -546,81 +570,93 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachineFragment labVirtualMachine, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachineFragment labVirtualMachine, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (labVirtualMachine == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labVirtualMachine"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (labVirtualMachine == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labVirtualMachine"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("labVirtualMachine", labVirtualMachine); + 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.DevTestLab/labs/{labName}/virtualmachines/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -632,61 +668,62 @@ internal VirtualMachinesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(labVirtualMachine != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(labVirtualMachine, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(labVirtualMachine, 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); } + 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) @@ -696,9 +733,10 @@ internal VirtualMachinesOperations(DevTestLabsClient 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(); @@ -709,25 +747,29 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Attach a new or existing data disk to virtual machine. This operation can /// take a while to complete. @@ -742,16 +784,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// Request body for adding a new or existing data disk to a virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task AddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task AddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginAddDataDiskWithHttpMessagesAsync(labName, name, dataDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginAddDataDiskWithHttpMessagesAsync(labName, name, dataDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -768,16 +810,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// Request body for applying artifacts to a virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginApplyArtifactsWithHttpMessagesAsync(labName, name, applyArtifactsRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginApplyArtifactsWithHttpMessagesAsync(labName, name, applyArtifactsRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -791,16 +833,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ClaimWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ClaimWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginClaimWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginClaimWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -817,16 +859,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// Request body for detaching data disk from a virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDetachDataDiskWithHttpMessagesAsync(labName, name, detachDataDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDetachDataDiskWithHttpMessagesAsync(labName, name, detachDataDiskProperties, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -844,13 +886,13 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 /// /// @@ -859,76 +901,88 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListApplicableSchedulesWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListApplicableSchedulesWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListApplicableSchedules", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListApplicableSchedules", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -940,55 +994,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -998,9 +1053,10 @@ internal VirtualMachinesOperations(DevTestLabsClient 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(); @@ -1011,25 +1067,29 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Start a virtual machine. This operation can take a while to complete. /// @@ -1040,16 +1100,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1062,16 +1122,16 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StopWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1093,13 +1153,13 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 /// /// @@ -1108,81 +1168,94 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, LabVirtualMachine labVirtualMachine, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (labVirtualMachine == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labVirtualMachine"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (labVirtualMachine == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labVirtualMachine"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("labVirtualMachine", labVirtualMachine); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{labName}/virtualmachines/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1194,61 +1267,62 @@ internal VirtualMachinesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(labVirtualMachine != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(labVirtualMachine, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(labVirtualMachine, 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); } + 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) @@ -1258,9 +1332,10 @@ internal VirtualMachinesOperations(DevTestLabsClient 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(); @@ -1271,16 +1346,16 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 @@ -1289,25 +1364,29 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 virtual machine. This operation can take a while to complete. /// @@ -1323,10 +1402,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1335,76 +1414,88 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + 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.DevTestLab/labs/{labName}/virtualmachines/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1416,55 +1507,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -1474,20 +1566,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Attach a new or existing data disk to virtual machine. This operation can /// take a while to complete. @@ -1507,10 +1604,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1519,81 +1616,94 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginAddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginAddDataDiskWithHttpMessagesAsync(string labName, string name, DataDiskProperties dataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (dataDiskProperties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataDiskProperties"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (dataDiskProperties == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataDiskProperties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("dataDiskProperties", dataDiskProperties); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAddDataDisk", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAddDataDisk", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/addDataDisk").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1605,61 +1715,62 @@ internal VirtualMachinesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(dataDiskProperties != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dataDiskProperties, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataDiskProperties, 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); } + 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) @@ -1669,20 +1780,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Apply artifacts to virtual machine. This operation can take a while to /// complete. @@ -1702,10 +1818,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1714,81 +1830,94 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginApplyArtifactsWithHttpMessagesAsync(string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (applyArtifactsRequest == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applyArtifactsRequest"); + } + + 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - if (applyArtifactsRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "applyArtifactsRequest"); - } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("applyArtifactsRequest", applyArtifactsRequest); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApplyArtifacts", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginApplyArtifacts", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1800,61 +1929,62 @@ internal VirtualMachinesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(applyArtifactsRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(applyArtifactsRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(applyArtifactsRequest, 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); } + 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) @@ -1864,20 +1994,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Take ownership of an existing virtual machine This operation can take a /// while to complete. @@ -1894,10 +2029,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1906,76 +2041,88 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginClaimWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginClaimWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginClaim", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginClaim", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/claim").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1987,55 +2134,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -2045,20 +2193,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Detach the specified disk from the virtual machine. This operation can take /// a while to complete. @@ -2078,10 +2231,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2090,81 +2243,94 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDetachDataDiskWithHttpMessagesAsync(string labName, string name, DetachDataDiskProperties detachDataDiskProperties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (detachDataDiskProperties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "detachDataDiskProperties"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (detachDataDiskProperties == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "detachDataDiskProperties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("detachDataDiskProperties", detachDataDiskProperties); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDetachDataDisk", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDetachDataDisk", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/detachDataDisk").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -2176,61 +2342,62 @@ internal VirtualMachinesOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(detachDataDiskProperties != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(detachDataDiskProperties, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(detachDataDiskProperties, 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); } + 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) @@ -2240,20 +2407,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Start a virtual machine. This operation can take a while to complete. /// @@ -2269,10 +2441,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2281,76 +2453,88 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/start").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -2362,55 +2546,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -2420,20 +2605,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// Stop a virtual machine This operation can take a while to complete. /// @@ -2449,10 +2639,10 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2461,76 +2651,88 @@ internal VirtualMachinesOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStopWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStopWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStop", 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.DevTestLab/labs/{labName}/virtualmachines/{name}/stop").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -2542,55 +2744,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -2600,20 +2803,25 @@ internal VirtualMachinesOperations(DevTestLabsClient 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; - } + + + + + } /// /// List virtual machines in a given lab. /// @@ -2626,13 +2834,13 @@ internal VirtualMachinesOperations(DevTestLabsClient 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 /// /// @@ -2641,51 +2849,54 @@ internal VirtualMachinesOperations(DevTestLabsClient 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) @@ -2697,55 +2908,56 @@ internal VirtualMachinesOperations(DevTestLabsClient 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); } + 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) @@ -2755,9 +2967,10 @@ internal VirtualMachinesOperations(DevTestLabsClient 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(); @@ -2768,24 +2981,28 @@ internal VirtualMachinesOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs index 41162ddce27c..ad4d9df44901 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs @@ -1,900 +1,815 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachinesOperations. + /// Extension methods for VirtualMachinesOperations /// public static partial class VirtualMachinesOperationsExtensions { - /// - /// List virtual machines in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IVirtualMachinesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// List virtual machines in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachinesOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' - /// - public static LabVirtualMachine Get(this IVirtualMachinesOperations operations, string labName, string name, string expand = default(string)) - { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); - } - - /// - /// Get virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Specify the $expand query. Example: - /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachinesOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing Virtual machine. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// A virtual machine. - /// - public static LabVirtualMachine CreateOrUpdate(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine) - { - return operations.CreateOrUpdateAsync(labName, name, labVirtualMachine).GetAwaiter().GetResult(); - } - - /// - /// Create or replace an existing Virtual machine. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// A virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void Delete(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Modify properties of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// A virtual machine. - /// - public static LabVirtualMachine Update(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachineFragment labVirtualMachine) - { - return operations.UpdateAsync(labName, name, labVirtualMachine).GetAwaiter().GetResult(); - } - - /// - /// Modify properties of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// A virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachineFragment labVirtualMachine, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Attach a new or existing data disk to virtual machine. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for adding a new or existing data disk to a virtual machine. - /// - public static void AddDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties) - { - operations.AddDataDiskAsync(labName, name, dataDiskProperties).GetAwaiter().GetResult(); - } - - /// - /// Attach a new or existing data disk to virtual machine. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for adding a new or existing data disk to a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task AddDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.AddDataDiskWithHttpMessagesAsync(labName, name, dataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Apply artifacts to virtual machine. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for applying artifacts to a virtual machine. - /// - public static void ApplyArtifacts(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest) - { - operations.ApplyArtifactsAsync(labName, name, applyArtifactsRequest).GetAwaiter().GetResult(); - } - - /// - /// Apply artifacts to virtual machine. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for applying artifacts to a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ApplyArtifactsAsync(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ApplyArtifactsWithHttpMessagesAsync(labName, name, applyArtifactsRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Take ownership of an existing virtual machine This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void Claim(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.ClaimAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Take ownership of an existing virtual machine This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ClaimAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ClaimWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Detach the specified disk from the virtual machine. This operation can take - /// a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for detaching data disk from a virtual machine. - /// - public static void DetachDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties) - { - operations.DetachDataDiskAsync(labName, name, detachDataDiskProperties).GetAwaiter().GetResult(); - } - - /// - /// Detach the specified disk from the virtual machine. This operation can take - /// a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for detaching data disk from a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task DetachDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DetachDataDiskWithHttpMessagesAsync(labName, name, detachDataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all applicable schedules - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static ApplicableSchedule ListApplicableSchedules(this IVirtualMachinesOperations operations, string labName, string name) - { - return operations.ListApplicableSchedulesAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Lists all applicable schedules - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ListApplicableSchedulesAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListApplicableSchedulesWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Start a virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void Start(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.StartAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Start a virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stop a virtual machine This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void Stop(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.StopAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Stop a virtual machine This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task StopAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StopWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or replace an existing Virtual machine. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// A virtual machine. - /// - public static LabVirtualMachine BeginCreateOrUpdate(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine) - { - return operations.BeginCreateOrUpdateAsync(labName, name, labVirtualMachine).GetAwaiter().GetResult(); - } - - /// - /// Create or replace an existing Virtual machine. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// A virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginDelete(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Attach a new or existing data disk to virtual machine. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for adding a new or existing data disk to a virtual machine. - /// - public static void BeginAddDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties) - { - operations.BeginAddDataDiskAsync(labName, name, dataDiskProperties).GetAwaiter().GetResult(); - } - - /// - /// Attach a new or existing data disk to virtual machine. This operation can - /// take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for adding a new or existing data disk to a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginAddDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginAddDataDiskWithHttpMessagesAsync(labName, name, dataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Apply artifacts to virtual machine. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for applying artifacts to a virtual machine. - /// - public static void BeginApplyArtifacts(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest) - { - operations.BeginApplyArtifactsAsync(labName, name, applyArtifactsRequest).GetAwaiter().GetResult(); - } - - /// - /// Apply artifacts to virtual machine. This operation can take a while to - /// complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for applying artifacts to a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginApplyArtifactsAsync(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginApplyArtifactsWithHttpMessagesAsync(labName, name, applyArtifactsRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Take ownership of an existing virtual machine This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginClaim(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.BeginClaimAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Take ownership of an existing virtual machine This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginClaimAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginClaimWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Detach the specified disk from the virtual machine. This operation can take - /// a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for detaching data disk from a virtual machine. - /// - public static void BeginDetachDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties) - { - operations.BeginDetachDataDiskAsync(labName, name, detachDataDiskProperties).GetAwaiter().GetResult(); - } - - /// - /// Detach the specified disk from the virtual machine. This operation can take - /// a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Request body for detaching data disk from a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDetachDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDetachDataDiskWithHttpMessagesAsync(labName, name, detachDataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Start a virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginStart(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.BeginStartAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Start a virtual machine. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stop a virtual machine This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginStop(this IVirtualMachinesOperations operations, string labName, string name) - { - operations.BeginStopAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Stop a virtual machine This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopAsync(this IVirtualMachinesOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStopWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List virtual machines in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachinesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List virtual machines in a given lab. - /// - /// - /// 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 IVirtualMachinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// List virtual machines in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachinesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IVirtualMachinesOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// List virtual machines in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachinesOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Specify the $expand query. Example: + /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + /// + public static LabVirtualMachine Get(this IVirtualMachinesOperations operations, string labName, string name, string expand = default(string)) + { + return ((IVirtualMachinesOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } + + /// + /// Get virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Specify the $expand query. Example: + /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachinesOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static LabVirtualMachine CreateOrUpdate(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine) + { + return ((IVirtualMachinesOperations)operations).CreateOrUpdateAsync(labName, name, labVirtualMachine).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void Delete(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static LabVirtualMachine Update(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachineFragment labVirtualMachine) + { + return ((IVirtualMachinesOperations)operations).UpdateAsync(labName, name, labVirtualMachine).GetAwaiter().GetResult(); + } + + /// + /// Modify properties of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachineFragment labVirtualMachine, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void AddDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties) + { + ((IVirtualMachinesOperations)operations).AddDataDiskAsync(labName, name, dataDiskProperties).GetAwaiter().GetResult(); + } + + /// + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AddDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.AddDataDiskWithHttpMessagesAsync(labName, name, dataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void ApplyArtifacts(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest) + { + ((IVirtualMachinesOperations)operations).ApplyArtifactsAsync(labName, name, applyArtifactsRequest).GetAwaiter().GetResult(); + } + + /// + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ApplyArtifactsAsync(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ApplyArtifactsWithHttpMessagesAsync(labName, name, applyArtifactsRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void Claim(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).ClaimAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ClaimAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ClaimWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void DetachDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties) + { + ((IVirtualMachinesOperations)operations).DetachDataDiskAsync(labName, name, detachDataDiskProperties).GetAwaiter().GetResult(); + } + + /// + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DetachDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DetachDataDiskWithHttpMessagesAsync(labName, name, detachDataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all applicable schedules + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static ApplicableSchedule ListApplicableSchedules(this IVirtualMachinesOperations operations, string labName, string name) + { + return ((IVirtualMachinesOperations)operations).ListApplicableSchedulesAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Lists all applicable schedules + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListApplicableSchedulesAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListApplicableSchedulesWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Start a virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void Start(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).StartAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Start a virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stop a virtual machine This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void Stop(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).StopAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Stop a virtual machine This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StopAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StopWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static LabVirtualMachine BeginCreateOrUpdate(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine) + { + return ((IVirtualMachinesOperations)operations).BeginCreateOrUpdateAsync(labName, name, labVirtualMachine).GetAwaiter().GetResult(); + } + + /// + /// Create or replace an existing Virtual machine. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachinesOperations operations, string labName, string name, LabVirtualMachine labVirtualMachine, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginDelete(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginAddDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties) + { + ((IVirtualMachinesOperations)operations).BeginAddDataDiskAsync(labName, name, dataDiskProperties).GetAwaiter().GetResult(); + } + + /// + /// Attach a new or existing data disk to virtual machine. This operation can + /// take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAddDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DataDiskProperties dataDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginAddDataDiskWithHttpMessagesAsync(labName, name, dataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginApplyArtifacts(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest) + { + ((IVirtualMachinesOperations)operations).BeginApplyArtifactsAsync(labName, name, applyArtifactsRequest).GetAwaiter().GetResult(); + } + + /// + /// Apply artifacts to virtual machine. This operation can take a while to + /// complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginApplyArtifactsAsync(this IVirtualMachinesOperations operations, string labName, string name, ApplyArtifactsRequest applyArtifactsRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginApplyArtifactsWithHttpMessagesAsync(labName, name, applyArtifactsRequest, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginClaim(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).BeginClaimAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Take ownership of an existing virtual machine This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginClaimAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginClaimWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginDetachDataDisk(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties) + { + ((IVirtualMachinesOperations)operations).BeginDetachDataDiskAsync(labName, name, detachDataDiskProperties).GetAwaiter().GetResult(); + } + + /// + /// Detach the specified disk from the virtual machine. This operation can take + /// a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDetachDataDiskAsync(this IVirtualMachinesOperations operations, string labName, string name, DetachDataDiskProperties detachDataDiskProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDetachDataDiskWithHttpMessagesAsync(labName, name, detachDataDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Start a virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginStart(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).BeginStartAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Start a virtual machine. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Stop a virtual machine This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginStop(this IVirtualMachinesOperations operations, string labName, string name) + { + ((IVirtualMachinesOperations)operations).BeginStopAsync(labName, name).GetAwaiter().GetResult(); + } + + /// + /// Stop a virtual machine This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStopAsync(this IVirtualMachinesOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStopWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List virtual machines in a given lab. + /// + /// + /// 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 IVirtualMachinesOperations operations, string nextPageLink) + { + return ((IVirtualMachinesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List virtual machines in a given lab. + /// + /// + /// 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 IVirtualMachinesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperations.cs index 07911d8bfc88..30c2f8b89da2 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperations.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperations.cs @@ -1,32 +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.DevTestLabs { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; 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; /// /// VirtualNetworksOperations operations. /// - internal partial class VirtualNetworksOperations : IServiceOperations, IVirtualNetworksOperations + internal partial class VirtualNetworksOperations : Microsoft.Rest.IServiceOperations, IVirtualNetworksOperations { /// /// Initializes a new instance of the VirtualNetworksOperations class. @@ -37,13 +24,13 @@ internal partial class VirtualNetworksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualNetworksOperations(DevTestLabsClient client) + internal VirtualNetworksOperations (DevTestLabsClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -54,25 +41,25 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// List virtual networks in a given lab. /// + /// + /// + /// /// /// The name of the lab. /// - /// - /// OData parameters to apply to the 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 /// /// @@ -81,79 +68,91 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - 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("odataQuery", odataQuery); tracingParameters.Add("labName", labName); + + 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.DevTestLab/labs/{labName}/virtualnetworks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _virtualNetwork = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_virtualNetwork)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_virtualNetwork); } } - if (Client.ApiVersion != null) + 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) @@ -165,55 +164,56 @@ internal VirtualNetworksOperations(DevTestLabsClient 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); } + 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) @@ -223,9 +223,10 @@ internal VirtualNetworksOperations(DevTestLabsClient 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(); @@ -236,25 +237,29 @@ internal VirtualNetworksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Get virtual network. /// @@ -265,7 +270,7 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// The name of the virtual network. /// /// - /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' + /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' /// /// /// Headers that will be added to request. @@ -273,13 +278,13 @@ internal VirtualNetworksOperations(DevTestLabsClient 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 /// /// @@ -288,81 +293,94 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string labName, string name, string expand = default(string), 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DevTestLab/labs/{labName}/virtualnetworks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (Client.ApiVersion != null) + 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) @@ -374,55 +392,56 @@ internal VirtualNetworksOperations(DevTestLabsClient 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); } + 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) @@ -432,9 +451,10 @@ internal VirtualNetworksOperations(DevTestLabsClient 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(); @@ -445,25 +465,29 @@ internal VirtualNetworksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing virtual network. This operation can take a /// while to complete. @@ -478,16 +502,16 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// A virtual network. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, virtualNetwork, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, virtualNetwork, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -500,16 +524,16 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// The name of the virtual network. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string labName, string name, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(labName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -530,13 +554,13 @@ internal VirtualNetworksOperations(DevTestLabsClient 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 /// /// @@ -545,81 +569,93 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string labName, string name, VirtualNetworkFragment virtualNetwork, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string labName, string name, VirtualNetworkFragment virtualNetwork, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (virtualNetwork == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetwork"); } - if (Client.ResourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (virtualNetwork == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetwork"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("virtualNetwork", virtualNetwork); + 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.DevTestLab/labs/{labName}/virtualnetworks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -631,61 +667,62 @@ internal VirtualNetworksOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(virtualNetwork != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetwork, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetwork, 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); } + 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) @@ -695,9 +732,10 @@ internal VirtualNetworksOperations(DevTestLabsClient 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(); @@ -708,25 +746,29 @@ internal VirtualNetworksOperations(DevTestLabsClient 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; - } + + + + + } /// /// Create or replace an existing virtual network. This operation can take a /// while to complete. @@ -746,13 +788,13 @@ internal VirtualNetworksOperations(DevTestLabsClient 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 /// /// @@ -761,81 +803,94 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string labName, string name, VirtualNetwork virtualNetwork, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (virtualNetwork == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualNetwork"); } - if (Client.ResourceGroupName == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (labName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } - if (name == null) + + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } - if (virtualNetwork == null) + + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetwork"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + tracingParameters.Add("virtualNetwork", virtualNetwork); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DevTestLab/labs/{labName}/virtualnetworks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -847,61 +902,62 @@ internal VirtualNetworksOperations(DevTestLabsClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(virtualNetwork != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetwork, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetwork, 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); } + 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) @@ -911,9 +967,10 @@ internal VirtualNetworksOperations(DevTestLabsClient 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(); @@ -924,16 +981,16 @@ internal VirtualNetworksOperations(DevTestLabsClient 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 @@ -942,25 +999,29 @@ internal VirtualNetworksOperations(DevTestLabsClient 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 virtual network. This operation can take a while to complete. /// @@ -976,10 +1037,10 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -988,76 +1049,88 @@ internal VirtualNetworksOperations(DevTestLabsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string labName, string name, 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.ResourceGroupName == null) + + if (this.Client.ResourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); } + if (labName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "labName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "labName"); } + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name"); } - 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("labName", labName); tracingParameters.Add("name", name); + + 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.DevTestLab/labs/{labName}/virtualnetworks/{name}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(this.Client.ResourceGroupName)); _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - 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) @@ -1069,55 +1142,56 @@ internal VirtualNetworksOperations(DevTestLabsClient 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); } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((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) @@ -1127,20 +1201,25 @@ internal VirtualNetworksOperations(DevTestLabsClient 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; - } + + + + + } /// /// List virtual networks in a given lab. /// @@ -1153,13 +1232,13 @@ internal VirtualNetworksOperations(DevTestLabsClient 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 /// /// @@ -1168,51 +1247,54 @@ internal VirtualNetworksOperations(DevTestLabsClient 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) @@ -1224,55 +1306,56 @@ internal VirtualNetworksOperations(DevTestLabsClient 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); } + 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) @@ -1282,9 +1365,10 @@ internal VirtualNetworksOperations(DevTestLabsClient 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(); @@ -1295,24 +1379,28 @@ internal VirtualNetworksOperations(DevTestLabsClient 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/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs index e9850feacb55..43ee23e8258b 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs @@ -1,362 +1,326 @@ -// // 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.DevTestLabs { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualNetworksOperations. + /// Extension methods for VirtualNetworksOperations /// public static partial class VirtualNetworksOperationsExtensions { - /// - /// List virtual networks in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IVirtualNetworksOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(labName, odataQuery).GetAwaiter().GetResult(); - } + /// + /// List virtual networks in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualNetworksOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return ((IVirtualNetworksOperations)operations).ListAsync(labName, odataQuery).GetAwaiter().GetResult(); + } - /// - /// List virtual networks in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualNetworksOperations operations, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List virtual networks in a given lab. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the lab. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualNetworksOperations operations, string labName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(labName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' + /// + public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string labName, string name, string expand = default(string)) + { + return ((IVirtualNetworksOperations)operations).GetAsync(labName, name, expand).GetAwaiter().GetResult(); + } - /// - /// Get virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' - /// - public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string labName, string name, string expand = default(string)) + /// + /// Get virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualNetworksOperations operations, string labName, string name, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(labName, name, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork) + { + return ((IVirtualNetworksOperations)operations).CreateOrUpdateAsync(labName, name, virtualNetwork).GetAwaiter().GetResult(); + } - /// - /// Get virtual network. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// Specify the $expand query. Example: 'properties($expand=externalSubnets)' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworksOperations operations, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(labName, name, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete virtual network. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + public static void Delete(this IVirtualNetworksOperations operations, string labName, string name) + { + ((IVirtualNetworksOperations)operations).DeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing virtual network. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// A virtual network. - /// - public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork) - { - return operations.CreateOrUpdateAsync(labName, name, virtualNetwork).GetAwaiter().GetResult(); - } + /// + /// Delete virtual network. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualNetworksOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Modify properties of virtual networks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + public static VirtualNetwork Update(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetworkFragment virtualNetwork) + { + return ((IVirtualNetworksOperations)operations).UpdateAsync(labName, name, virtualNetwork).GetAwaiter().GetResult(); + } - /// - /// Create or replace an existing virtual network. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// A virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Modify properties of virtual networks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetworkFragment virtualNetwork, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork) + { + return ((IVirtualNetworksOperations)operations).BeginCreateOrUpdateAsync(labName, name, virtualNetwork).GetAwaiter().GetResult(); + } - /// - /// Delete virtual network. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - public static void Delete(this IVirtualNetworksOperations operations, string labName, string name) + /// + /// Create or replace an existing virtual network. This operation can take a + /// while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(labName, name).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete virtual network. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + public static void BeginDelete(this IVirtualNetworksOperations operations, string labName, string name) + { + ((IVirtualNetworksOperations)operations).BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); + } - /// - /// Delete virtual network. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworksOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete virtual network. This operation can take a while to complete. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the lab. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string labName, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List virtual networks in a given lab. + /// + /// + /// 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 IVirtualNetworksOperations operations, string nextPageLink) + { + return ((IVirtualNetworksOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Modify properties of virtual networks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// A virtual network. - /// - public static VirtualNetwork Update(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetworkFragment virtualNetwork) + /// + /// List virtual networks in a given lab. + /// + /// + /// 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 IVirtualNetworksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(labName, name, virtualNetwork).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Modify properties of virtual networks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// A virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetworkFragment virtualNetwork, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or replace an existing virtual network. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// A virtual network. - /// - public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork) - { - return operations.BeginCreateOrUpdateAsync(labName, name, virtualNetwork).GetAwaiter().GetResult(); - } - - /// - /// Create or replace an existing virtual network. This operation can take a - /// while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// A virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string labName, string name, VirtualNetwork virtualNetwork, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(labName, name, virtualNetwork, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete virtual network. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - public static void BeginDelete(this IVirtualNetworksOperations operations, string labName, string name) - { - operations.BeginDeleteAsync(labName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete virtual network. This operation can take a while to complete. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the lab. - /// - /// - /// The name of the virtual network. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string labName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List virtual networks in a given lab. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualNetworksOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List virtual networks in a given lab. - /// - /// - /// 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 IVirtualNetworksOperations 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/DevTestLabs/DevTestLabs.Management.Sdk/README.md b/src/DevTestLabs/DevTestLabs.Management.Sdk/README.md index 0f423853b479..e0dde363d5ca 100644 --- a/src/DevTestLabs/DevTestLabs.Management.Sdk/README.md +++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/README.md @@ -5,14 +5,14 @@ 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 diff --git a/src/DevTestLabs/DevTestLabs.sln b/src/DevTestLabs/DevTestLabs.sln index 325d16746249..065bbfc48dd2 100644 --- a/src/DevTestLabs/DevTestLabs.sln +++ b/src/DevTestLabs/DevTestLabs.sln @@ -85,7 +85,6 @@ Global {F2A68427-CD57-4A36-B602-21E00A01C731} = {3F69E5C5-71CF-4683-A9C8-53BA3A1A5DDF} {AA4EFB70-22FE-41C0-9179-6BF1422E7B0D} = {3F69E5C5-71CF-4683-A9C8-53BA3A1A5DDF} {47D9666F-225C-469C-98F1-BF687A115975} = {222F330A-327F-4122-AE98-B948918EF747} - {F1CA7D35-9D66-4C8E-82C8-BD2AE52133D6} = {222F330A-327F-4122-AE98-B948918EF747} {61354667-C9E3-45E3-9515-73060817E727} = {222F330A-327F-4122-AE98-B948918EF747} EndGlobalSection EndGlobal