From 6671f48e21fc291d2f0ccbdb3ce78e30e75b85b2 Mon Sep 17 00:00:00 2001
From: JoyerJin <116236375+JoyerJin@users.noreply.github.com>
Date: Mon, 28 Oct 2024 15:29:18 +0800
Subject: [PATCH 1/8] generate DevTestLabs by autorest v2
---
.../DevTestLabs.Management.Sdk.csproj | 13 +
.../Generated/ArmTemplatesOperations.cs | 667 +++
.../ArmTemplatesOperationsExtensions.cs | 170 +
.../Generated/ArtifactSourcesOperations.cs | 1289 +++++
.../ArtifactSourcesOperationsExtensions.cs | 305 ++
.../Generated/ArtifactsOperations.cs | 896 ++++
.../ArtifactsOperationsExtensions.cs | 230 +
.../Generated/CostsOperations.cs | 504 ++
.../Generated/CostsOperationsExtensions.cs | 129 +
.../Generated/CustomImagesOperations.cs | 1348 ++++++
.../CustomImagesOperationsExtensions.cs | 404 ++
.../Generated/DevTestLabsClient.cs | 504 ++
.../Generated/DisksOperations.cs | 1875 ++++++++
.../Generated/DisksOperationsExtensions.cs | 674 +++
.../Generated/EnvironmentsOperations.cs | 1396 ++++++
.../EnvironmentsOperationsExtensions.cs | 448 ++
.../Generated/FormulasOperations.cs | 1319 ++++++
.../Generated/FormulasOperationsExtensions.cs | 361 ++
.../Generated/GalleryImagesOperations.cs | 436 ++
.../GalleryImagesOperationsExtensions.cs | 106 +
.../Generated/GlobalSchedulesOperations.cs | 2020 ++++++++
.../GlobalSchedulesOperationsExtensions.cs | 507 ++
.../Generated/IArmTemplatesOperations.cs | 116 +
.../Generated/IArtifactSourcesOperations.cs | 197 +
.../Generated/IArtifactsOperations.cs | 151 +
.../Generated/ICostsOperations.cs | 90 +
.../Generated/ICustomImagesOperations.cs | 254 +
.../Generated/IDevTestLabsClient.cs | 198 +
.../Generated/IDisksOperations.cs | 403 ++
.../Generated/IEnvironmentsOperations.cs | 276 ++
.../Generated/IFormulasOperations.cs | 233 +
.../Generated/IGalleryImagesOperations.cs | 78 +
.../Generated/IGlobalSchedulesOperations.cs | 321 ++
.../Generated/ILabsOperations.cs | 557 +++
.../INotificationChannelsOperations.cs | 225 +
.../Generated/IOperations.cs | 52 +
.../Generated/IPoliciesOperations.cs | 212 +
.../Generated/IPolicySetsOperations.cs | 58 +
.../Generated/IProviderOperations.cs | 68 +
.../Generated/ISchedulesOperations.cs | 296 ++
.../Generated/ISecretsOperations.cs | 247 +
.../IServiceFabricSchedulesOperations.cs | 288 ++
.../Generated/IServiceFabricsOperations.cs | 421 ++
.../Generated/IServiceRunnersOperations.cs | 162 +
.../Generated/IUsersOperations.cs | 254 +
.../IVirtualMachineSchedulesOperations.cs | 267 ++
.../Generated/IVirtualMachinesOperations.cs | 912 ++++
.../Generated/IVirtualNetworksOperations.cs | 257 +
.../Generated/LabsOperations.cs | 3085 ++++++++++++
.../Generated/LabsOperationsExtensions.cs | 904 ++++
.../Generated/Models/ApplicableSchedule.cs | 75 +
.../Models/ApplicableScheduleFragment.cs | 71 +
.../Generated/Models/ApplyArtifactsRequest.cs | 53 +
.../Generated/Models/ArmTemplate.cs | 125 +
.../Generated/Models/ArmTemplateInfo.cs | 60 +
.../Models/ArmTemplateParameterProperties.cs | 61 +
.../ArmTemplateParameterPropertiesFragment.cs | 61 +
.../Generated/Models/Artifact.cs | 118 +
.../ArtifactDeploymentStatusProperties.cs | 74 +
...ifactDeploymentStatusPropertiesFragment.cs | 74 +
.../Models/ArtifactInstallProperties.cs | 105 +
.../ArtifactInstallPropertiesFragment.cs | 107 +
.../Models/ArtifactParameterProperties.cs | 61 +
.../ArtifactParameterPropertiesFragment.cs | 61 +
.../Generated/Models/ArtifactSource.cs | 156 +
.../Models/ArtifactSourceFragment.cs | 125 +
.../Generated/Models/AttachDiskProperties.cs | 53 +
.../Models/AttachNewDataDiskOptions.cs | 71 +
.../AttachNewDataDiskOptionsFragment.cs | 73 +
.../Models/BulkCreationParameters.cs | 52 +
.../Models/BulkCreationParametersFragment.cs | 54 +
.../Generated/Models/ComputeDataDisk.cs | 78 +
.../Models/ComputeDataDiskFragment.cs | 78 +
.../Models/ComputeVmInstanceViewStatus.cs | 71 +
.../ComputeVmInstanceViewStatusFragment.cs | 71 +
.../Generated/Models/ComputeVmProperties.cs | 107 +
.../Models/ComputeVmPropertiesFragment.cs | 109 +
.../Models/CostThresholdProperties.cs | 94 +
.../Generated/Models/CostThresholdStatus.cs | 22 +
.../Generated/Models/CostType.cs | 23 +
.../Generated/Models/CustomImage.cs | 179 +
.../Generated/Models/CustomImageFragment.cs | 135 +
.../Generated/Models/CustomImageOsType.cs | 23 +
.../Models/CustomImagePropertiesCustom.cs | 86 +
.../CustomImagePropertiesCustomFragment.cs | 72 +
.../Models/CustomImagePropertiesFromPlan.cs | 74 +
.../CustomImagePropertiesFromPlanFragment.cs | 74 +
.../Models/CustomImagePropertiesFromVm.cs | 71 +
.../CustomImagePropertiesFromVmFragment.cs | 71 +
.../Generated/Models/DataDiskProperties.cs | 76 +
.../Models/DataDiskPropertiesFragment.cs | 76 +
.../Models/DataDiskStorageTypeInfo.cs | 61 +
.../Models/DataDiskStorageTypeInfoFragment.cs | 63 +
.../Generated/Models/DayDetails.cs | 51 +
.../Generated/Models/DayDetailsFragment.cs | 51 +
.../Models/DetachDataDiskProperties.cs | 53 +
.../Generated/Models/DetachDiskProperties.cs | 53 +
.../Generated/Models/Disk.cs | 149 +
.../Generated/Models/DiskFragment.cs | 119 +
.../Generated/Models/DtlEnvironment.cs | 109 +
.../Models/DtlEnvironmentFragment.cs | 69 +
.../Generated/Models/EnableStatus.cs | 22 +
.../Models/EnvironmentDeploymentProperties.cs | 65 +
...EnvironmentDeploymentPropertiesFragment.cs | 65 +
.../Generated/Models/EnvironmentPermission.cs | 22 +
.../Models/EvaluatePoliciesProperties.cs | 76 +
.../Models/EvaluatePoliciesRequest.cs | 53 +
.../Models/EvaluatePoliciesResponse.cs | 53 +
.../Generated/Models/EventFragment.cs | 55 +
.../Generated/Models/EventModel.cs | 55 +
.../Models/ExportResourceUsageParameters.cs | 68 +
.../Generated/Models/ExternalSubnet.cs | 59 +
.../Models/ExternalSubnetFragment.cs | 59 +
.../Generated/Models/FileUploadOptions.cs | 22 +
.../Generated/Models/Formula.cs | 124 +
.../Generated/Models/FormulaFragment.cs | 93 +
.../Models/FormulaPropertiesFromVm.cs | 53 +
.../Models/FormulaPropertiesFromVmFragment.cs | 55 +
.../Generated/Models/GalleryImage.cs | 125 +
.../Generated/Models/GalleryImageReference.cs | 83 +
.../Models/GalleryImageReferenceFragment.cs | 85 +
.../Models/GenerateArmTemplateRequest.cs | 84 +
.../Models/GenerateUploadUriParameter.cs | 51 +
.../Models/GenerateUploadUriResponse.cs | 51 +
.../Generated/Models/HostCachingOptions.cs | 23 +
.../Generated/Models/HourDetails.cs | 52 +
.../Generated/Models/HourDetailsFragment.cs | 52 +
.../Generated/Models/HttpStatusCode.cs | 62 +
.../Generated/Models/IdentityProperties.cs | 77 +
.../Models/ImportLabVirtualMachineRequest.cs | 65 +
.../Generated/Models/InboundNatRule.cs | 77 +
.../Models/InboundNatRuleFragment.cs | 77 +
.../Generated/Models/Lab.cs | 261 ++
.../Models/LabAnnouncementProperties.cs | 109 +
.../LabAnnouncementPropertiesFragment.cs | 93 +
.../Generated/Models/LabCost.cs | 140 +
.../Models/LabCostDetailsProperties.cs | 69 +
.../Models/LabCostSummaryProperties.cs | 52 +
.../Generated/Models/LabFragment.cs | 147 +
.../Models/LabResourceCostProperties.cs | 124 +
.../Generated/Models/LabSupportProperties.cs | 64 +
.../Models/LabSupportPropertiesFragment.cs | 66 +
.../Generated/Models/LabVhd.cs | 51 +
.../Generated/Models/LabVirtualMachine.cs | 382 ++
.../LabVirtualMachineCreationParameter.cs | 377 ++
...VirtualMachineCreationParameterFragment.cs | 377 ++
.../Models/LabVirtualMachineFragment.cs | 342 ++
.../Generated/Models/LinuxOsInfo.cs | 56 +
.../Generated/Models/LinuxOsInfoFragment.cs | 56 +
.../Generated/Models/LinuxOsState.cs | 23 +
.../Models/NetworkInterfaceProperties.cs | 127 +
.../NetworkInterfacePropertiesFragment.cs | 129 +
.../Generated/Models/NotificationChannel.cs | 129 +
.../Models/NotificationChannelEventType.cs | 22 +
.../Models/NotificationChannelFragment.cs | 100 +
.../Generated/Models/NotificationSettings.cs | 95 +
.../Models/NotificationSettingsFragment.cs | 97 +
.../Generated/Models/NotifyParameters.cs | 62 +
.../Generated/Models/OperationError.cs | 60 +
.../Generated/Models/OperationMetadata.cs | 61 +
.../Models/OperationMetadataDisplay.cs | 79 +
.../Generated/Models/OperationResult.cs | 94 +
.../Generated/Models/Page.cs | 53 +
.../Generated/Models/ParameterInfo.cs | 59 +
.../Models/ParametersValueFileInfo.cs | 59 +
.../PercentageCostThresholdProperties.cs | 53 +
.../Generated/Models/Policy.cs | 148 +
.../Generated/Models/PolicyEvaluatorType.cs | 22 +
.../Generated/Models/PolicyFactName.cs | 30 +
.../Generated/Models/PolicyFragment.cs | 118 +
.../Generated/Models/PolicySetResult.cs | 64 +
.../Generated/Models/PolicyStatus.cs | 22 +
.../Generated/Models/PolicyViolation.cs | 59 +
.../Generated/Models/Port.cs | 62 +
.../Generated/Models/PortFragment.cs | 62 +
.../Generated/Models/PremiumDataDisk.cs | 22 +
.../Generated/Models/RdpConnection.cs | 51 +
.../Generated/Models/ReportingCycleType.cs | 22 +
.../ResizeLabVirtualMachineProperties.cs | 54 +
.../Generated/Models/Resource.cs | 87 +
.../Models/RetargetScheduleProperties.cs | 63 +
.../Generated/Models/Schedule.cs | 157 +
.../Models/ScheduleCreationParameter.cs | 150 +
.../ScheduleCreationParameterFragment.cs | 152 +
.../Generated/Models/ScheduleFragment.cs | 126 +
.../Generated/Models/Secret.cs | 81 +
.../Generated/Models/SecretFragment.cs | 59 +
.../Generated/Models/ServiceFabric.cs | 100 +
.../Generated/Models/ServiceFabricFragment.cs | 69 +
.../Generated/Models/ServiceRunner.cs | 59 +
.../SharedPublicIpAddressConfiguration.cs | 56 +
...redPublicIpAddressConfigurationFragment.cs | 56 +
.../Models/ShutdownNotificationContent.cs | 158 +
.../Generated/Models/SourceControlType.cs | 22 +
.../Generated/Models/StorageType.cs | 22 +
.../Generated/Models/Subnet.cs | 72 +
.../Generated/Models/SubnetFragment.cs | 72 +
.../Generated/Models/SubnetOverride.cs | 104 +
.../Models/SubnetOverrideFragment.cs | 104 +
...ubnetSharedPublicIpAddressConfiguration.cs | 57 +
...redPublicIpAddressConfigurationFragment.cs | 57 +
.../Generated/Models/TargetCostProperties.cs | 98 +
.../Generated/Models/TargetCostStatus.cs | 22 +
.../Generated/Models/TransportProtocol.cs | 22 +
.../Generated/Models/UpdateResource.cs | 53 +
.../Generated/Models/UsagePermissionType.cs | 23 +
.../Generated/Models/User.cs | 97 +
.../Generated/Models/UserFragment.cs | 66 +
.../Generated/Models/UserIdentity.cs | 97 +
.../Generated/Models/UserIdentityFragment.cs | 97 +
.../Generated/Models/UserSecretStore.cs | 59 +
.../Models/UserSecretStoreFragment.cs | 59 +
.../Models/VirtualMachineCreationSource.cs | 22 +
.../Generated/Models/VirtualNetwork.cs | 127 +
.../Models/VirtualNetworkFragment.cs | 87 +
.../Generated/Models/WeekDetails.cs | 64 +
.../Generated/Models/WeekDetailsFragment.cs | 64 +
.../Generated/Models/WindowsOsInfo.cs | 56 +
.../Generated/Models/WindowsOsInfoFragment.cs | 56 +
.../Generated/Models/WindowsOsState.cs | 23 +
.../NotificationChannelsOperations.cs | 1487 ++++++
...otificationChannelsOperationsExtensions.cs | 354 ++
.../Generated/Operations.cs | 250 +
.../Generated/OperationsExtensions.cs | 65 +
.../Generated/PoliciesOperations.cs | 1334 ++++++
.../Generated/PoliciesOperationsExtensions.cs | 335 ++
.../Generated/PolicySetsOperations.cs | 273 ++
.../PolicySetsOperationsExtensions.cs | 77 +
.../Generated/ProviderOperations.cs | 400 ++
.../Generated/ProviderOperationsExtensions.cs | 87 +
.../Generated/SchedulesOperations.cs | 1876 ++++++++
.../SchedulesOperationsExtensions.cs | 471 ++
.../Generated/SdkInfo_DevTestLabsClient.cs | 51 +
.../Generated/SecretsOperations.cs | 1367 ++++++
.../Generated/SecretsOperationsExtensions.cs | 397 ++
.../ServiceFabricSchedulesOperations.cs | 1612 +++++++
...viceFabricSchedulesOperationsExtensions.cs | 475 ++
.../Generated/ServiceFabricsOperations.cs | 2052 ++++++++
.../ServiceFabricsOperationsExtensions.cs | 696 +++
.../Generated/ServiceRunnersOperations.cs | 1062 +++++
.../ServiceRunnersOperationsExtensions.cs | 247 +
.../Generated/UsersOperations.cs | 1344 ++++++
.../Generated/UsersOperationsExtensions.cs | 404 ++
.../VirtualMachineSchedulesOperations.cs | 1555 +++++++
...ualMachineSchedulesOperationsExtensions.cs | 433 ++
.../Generated/VirtualMachinesOperations.cs | 4135 +++++++++++++++++
.../VirtualMachinesOperationsExtensions.cs | 1518 ++++++
.../Generated/VirtualNetworksOperations.cs | 1344 ++++++
.../VirtualNetworksOperationsExtensions.cs | 404 ++
.../Properties/AssemblyInfo.cs | 29 +
.../DevTestLabs.Management.Sdk/README.md | 34 +
251 files changed, 66251 insertions(+)
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/DevTestLabs.Management.Sdk.csproj
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DevTestLabsClient.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/EnvironmentsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/FormulasOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/GlobalSchedulesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArmTemplatesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactSourcesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IArtifactsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICostsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ICustomImagesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDevTestLabsClient.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IDisksOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IEnvironmentsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IFormulasOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGalleryImagesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IGlobalSchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ILabsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/INotificationChannelsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPoliciesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IPolicySetsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IProviderOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ISecretsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceFabricSchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceFabricsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IServiceRunnersOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IUsersOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachineSchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualMachinesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/IVirtualNetworksOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/LabsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableSchedule.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplicableScheduleFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ApplyArtifactsRequest.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplate.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateParameterProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArmTemplateParameterPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Artifact.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactDeploymentStatusPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactInstallPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactParameterPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSource.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ArtifactSourceFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachDiskProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachNewDataDiskOptions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/AttachNewDataDiskOptionsFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/BulkCreationParameters.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/BulkCreationParametersFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDisk.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeDataDiskFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatus.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmInstanceViewStatusFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ComputeVmPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostThresholdStatus.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CostType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImage.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImageOsType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesCustom.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesCustomFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromPlan.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromPlanFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromVm.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/CustomImagePropertiesFromVmFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskStorageTypeInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DataDiskStorageTypeInfoFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetails.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DayDetailsFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDataDiskProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DetachDiskProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Disk.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DiskFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DtlEnvironment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/DtlEnvironmentFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnableStatus.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentDeploymentProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentDeploymentPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EnvironmentPermission.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesRequest.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EvaluatePoliciesResponse.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/EventModel.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExportResourceUsageParameters.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnet.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ExternalSubnetFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FileUploadOptions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Formula.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaPropertiesFromVm.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/FormulaPropertiesFromVmFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImage.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReference.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GalleryImageReferenceFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateArmTemplateRequest.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriParameter.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/GenerateUploadUriResponse.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HostCachingOptions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetails.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HourDetailsFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/HttpStatusCode.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/IdentityProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ImportLabVirtualMachineRequest.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRule.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/InboundNatRuleFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Lab.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabAnnouncementProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabAnnouncementPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCost.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostDetailsProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabCostSummaryProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabResourceCostProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabSupportProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabSupportPropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVhd.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachine.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameter.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineCreationParameterFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LabVirtualMachineFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsInfoFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/LinuxOsState.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfaceProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NetworkInterfacePropertiesFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannel.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelEventType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationChannelFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettings.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotificationSettingsFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/NotifyParameters.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationError.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadata.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationMetadataDisplay.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/OperationResult.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Page.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParameterInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ParametersValueFileInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PercentageCostThresholdProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Policy.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyEvaluatorType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFactName.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicySetResult.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyStatus.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PolicyViolation.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Port.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PortFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/PremiumDataDisk.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/RdpConnection.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ReportingCycleType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ResizeLabVirtualMachineProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Resource.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/RetargetScheduleProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Schedule.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleCreationParameter.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleCreationParameterFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ScheduleFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Secret.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SecretFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceFabric.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceFabricFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ServiceRunner.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfiguration.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SharedPublicIpAddressConfigurationFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/ShutdownNotificationContent.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SourceControlType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/StorageType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/Subnet.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverride.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetOverrideFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfiguration.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/SubnetSharedPublicIpAddressConfigurationFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostProperties.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TargetCostStatus.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/TransportProtocol.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UpdateResource.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UsagePermissionType.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/User.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentity.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserIdentityFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStore.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/UserSecretStoreFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualMachineCreationSource.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetwork.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/VirtualNetworkFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetails.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WeekDetailsFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsInfoFragment.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Models/WindowsOsState.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/NotificationChannelsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/Operations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/OperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PoliciesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/PolicySetsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ProviderOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SchedulesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SdkInfo_DevTestLabsClient.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/SecretsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceFabricSchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceFabricSchedulesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceFabricsOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceFabricsOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ServiceRunnersOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/UsersOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachineSchedulesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperations.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/VirtualNetworksOperationsExtensions.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/Properties/AssemblyInfo.cs
create mode 100644 src/DevTestLabs/DevTestLabs.Management.Sdk/README.md
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/DevTestLabs.Management.Sdk.csproj b/src/DevTestLabs/DevTestLabs.Management.Sdk/DevTestLabs.Management.Sdk.csproj
new file mode 100644
index 000000000000..441a3ab82e71
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/DevTestLabs.Management.Sdk.csproj
@@ -0,0 +1,13 @@
+
+
+ DevTestLabs
+
+
+
+ netstandard2.0
+ Microsoft.Azure.PowerShell.DevTestLabs.Management.Sdk
+ Microsoft.Azure.Management.DevTestLabs
+ $(NoWarn);CS0108;CS1573
+
+
+
\ No newline at end of file
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs
new file mode 100644
index 000000000000..ec387a5bacf8
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperations.cs
@@ -0,0 +1,667 @@
+//
+// 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
+{
+ 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
+ {
+ ///
+ /// Initializes a new instance of the ArmTemplatesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ArmTemplatesOperations(DevTestLabsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DevTestLabsClient
+ ///
+ public DevTestLabsClient Client { get; private set; }
+
+ ///
+ /// List azure resource manager templates in a given artifact source.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (artifactSourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("odataQuery", odataQuery);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("artifactSourceName", artifactSourceName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName));
+ List _queryParameters = new List();
+ if (odataQuery != null)
+ {
+ var _odataFilter = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_odataFilter))
+ {
+ _queryParameters.Add(_odataFilter);
+ }
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get azure resource manager template.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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)'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (artifactSourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("artifactSourceName", artifactSourceName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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 (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// List azure resource manager templates in a given artifact source.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs
new file mode 100644
index 000000000000..afc94bbbd57a
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArmTemplatesOperationsExtensions.cs
@@ -0,0 +1,170 @@
+//
+// 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
+{
+ 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.
+ ///
+ 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 resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery))
+ {
+ return operations.ListAsync(resourceGroupName, 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 resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, odataQuery, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get azure resource manager template.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string))
+ {
+ return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name, expand).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get azure resource manager template.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, expand, 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 NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IArmTemplatesOperations operations, string nextPageLink)
+ {
+ return 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.
+ ///
+ ///
+ /// 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
new file mode 100644
index 000000000000..63061ca56f84
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperations.cs
@@ -0,0 +1,1289 @@
+//
+// 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
+{
+ 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
+ {
+ ///
+ /// Initializes a new instance of the ArtifactSourcesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ArtifactSourcesOperations(DevTestLabsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DevTestLabsClient
+ ///
+ public DevTestLabsClient Client { get; private set; }
+
+ ///
+ /// List artifact sources in a given lab.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("odataQuery", odataQuery);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ List _queryParameters = new List();
+ if (odataQuery != null)
+ {
+ var _odataFilter = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_odataFilter))
+ {
+ _queryParameters.Add(_odataFilter);
+ }
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get artifact source.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// Specify the $expand query. Example: 'properties($select=displayName)'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or replace an existing artifact source.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// Properties of an artifact source.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ArtifactSource artifactSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (artifactSource == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("artifactSource", artifactSource);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(artifactSource != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(artifactSource, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete artifact source.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Modify properties of artifact sources.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// Properties of an artifact source.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, ArtifactSourceFragment artifactSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (artifactSource == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("artifactSource", artifactSource);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(artifactSource != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(artifactSource, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// List artifact sources in a given lab.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs
new file mode 100644
index 000000000000..fe37b564812f
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactSourcesOperationsExtensions.cs
@@ -0,0 +1,305 @@
+//
+// 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
+{
+ 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.
+ ///
+ public static partial class ArtifactSourcesOperationsExtensions
+ {
+ ///
+ /// List artifact sources in a given lab.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ public static IPage List(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery))
+ {
+ return operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List artifact sources in a given lab.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, string expand = default(string))
+ {
+ return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or replace an existing artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// Properties of an artifact source.
+ ///
+ public static ArtifactSource CreateOrUpdate(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, ArtifactSource artifactSource)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, labName, name, artifactSource).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or replace an existing artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, ArtifactSource artifactSource, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, artifactSource, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ public static void Delete(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name)
+ {
+ operations.DeleteAsync(resourceGroupName, labName, name).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Modify properties of artifact sources.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// Properties of an artifact source.
+ ///
+ public static ArtifactSource Update(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, ArtifactSourceFragment artifactSource)
+ {
+ return operations.UpdateAsync(resourceGroupName, labName, name, artifactSource).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Modify properties of artifact sources.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, ArtifactSourceFragment artifactSource, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, 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
new file mode 100644
index 000000000000..ab7a2811546d
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperations.cs
@@ -0,0 +1,896 @@
+//
+// 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
+{
+ 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
+ {
+ ///
+ /// Initializes a new instance of the ArtifactsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ArtifactsOperations(DevTestLabsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DevTestLabsClient
+ ///
+ public DevTestLabsClient Client { get; private set; }
+
+ ///
+ /// List artifacts in a given artifact source.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (artifactSourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("odataQuery", odataQuery);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("artifactSourceName", artifactSourceName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName));
+ List _queryParameters = new List();
+ if (odataQuery != null)
+ {
+ var _odataFilter = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_odataFilter))
+ {
+ _queryParameters.Add(_odataFilter);
+ }
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get artifact.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the artifact source.
+ ///
+ ///
+ /// The name of the artifact.
+ ///
+ ///
+ /// Specify the $expand query. Example: 'properties($select=title)'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (artifactSourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("artifactSourceName", artifactSourceName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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 (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// 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 resource group.
+ ///
+ ///
+ /// 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.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GenerateArmTemplateWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (artifactSourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSourceName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (generateArmTemplateRequest == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "generateArmTemplateRequest");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("artifactSourceName", artifactSourceName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("generateArmTemplateRequest", generateArmTemplateRequest);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GenerateArmTemplate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(generateArmTemplateRequest != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateArmTemplateRequest, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// List artifacts in a given artifact source.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs
new file mode 100644
index 000000000000..207fbb2fe011
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/ArtifactsOperationsExtensions.cs
@@ -0,0 +1,230 @@
+//
+// 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
+{
+ 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.
+ ///
+ public static partial class ArtifactsOperationsExtensions
+ {
+ ///
+ /// List artifacts in a given artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery))
+ {
+ return operations.ListAsync(resourceGroupName, labName, artifactSourceName, odataQuery).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List artifacts in a given artifact source.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, odataQuery, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get artifact.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string))
+ {
+ return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name, expand).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get artifact.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ {
+ 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 resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest)
+ {
+ return operations.GenerateArmTemplateAsync(resourceGroupName, labName, artifactSourceName, name, generateArmTemplateRequest).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 resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string artifactSourceName, string name, GenerateArmTemplateRequest generateArmTemplateRequest, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GenerateArmTemplateWithHttpMessagesAsync(resourceGroupName, 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
new file mode 100644
index 000000000000..e4131f6acdc6
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperations.cs
@@ -0,0 +1,504 @@
+//
+// 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
+{
+ 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
+ {
+ ///
+ /// Initializes a new instance of the CostsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal CostsOperations(DevTestLabsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DevTestLabsClient
+ ///
+ public DevTestLabsClient Client { get; private set; }
+
+ ///
+ /// Get cost.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the cost.
+ ///
+ ///
+ /// Specify the $expand query. Example: 'properties($expand=labCostDetails)'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or replace an existing cost.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the cost.
+ ///
+ ///
+ /// A cost item.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, LabCost labCost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (labCost == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labCost");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("labCost", labCost);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(labCost != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(labCost, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs
new file mode 100644
index 000000000000..499d0b1d761f
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CostsOperationsExtensions.cs
@@ -0,0 +1,129 @@
+//
+// 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
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for CostsOperations.
+ ///
+ public static partial class CostsOperationsExtensions
+ {
+ ///
+ /// Get cost.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, string expand = default(string))
+ {
+ return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get cost.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or replace an existing cost.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the cost.
+ ///
+ ///
+ /// A cost item.
+ ///
+ public static LabCost CreateOrUpdate(this ICostsOperations operations, string resourceGroupName, string labName, string name, LabCost labCost)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, labName, name, labCost).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or replace an existing cost.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, LabCost labCost, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, 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
new file mode 100644
index 000000000000..225a8c040b9a
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperations.cs
@@ -0,0 +1,1348 @@
+//
+// 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
+{
+ 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
+ {
+ ///
+ /// Initializes a new instance of the CustomImagesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal CustomImagesOperations(DevTestLabsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DevTestLabsClient
+ ///
+ public DevTestLabsClient Client { get; private set; }
+
+ ///
+ /// List custom images in a given lab.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("odataQuery", odataQuery);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ List _queryParameters = new List();
+ if (odataQuery != null)
+ {
+ var _odataFilter = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_odataFilter))
+ {
+ _queryParameters.Add(_odataFilter);
+ }
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get custom image.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// Specify the $expand query. Example: 'properties($select=vm)'
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or replace an existing custom image. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, CustomImage customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, customImage, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Delete custom image. This operation can take a while to complete.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, name, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Modify properties of custom images.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, CustomImageFragment customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (customImage == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "customImage");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("customImage", customImage);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(customImage != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customImage, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or replace an existing custom image. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string name, CustomImage customImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (customImage == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "customImage");
+ }
+ if (customImage != null)
+ {
+ customImage.Validate();
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("customImage", customImage);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(customImage != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(customImage, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete custom image. This operation can take a while to complete.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// List custom images in a given lab.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ 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));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs
new file mode 100644
index 000000000000..d600fc47b4d0
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/CustomImagesOperationsExtensions.cs
@@ -0,0 +1,404 @@
+//
+// 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
+{
+ 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.
+ ///
+ public static partial class CustomImagesOperationsExtensions
+ {
+ ///
+ /// List custom images in a given lab.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ public static IPage List(this ICustomImagesOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery))
+ {
+ return operations.ListAsync(resourceGroupName, labName, odataQuery).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List custom images in a given lab.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get custom image.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, string expand = default(string))
+ {
+ return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get custom image.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, 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 resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ public static CustomImage CreateOrUpdate(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CustomImage customImage)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, 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 resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, CustomImage customImage, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, customImage, null, cancellationToken).ConfigureAwait(false))
+ {
+ 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 resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ public static void Delete(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name)
+ {
+ operations.DeleteAsync(resourceGroupName, 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 resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Modify properties of custom images.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ public static CustomImage Update(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CustomImageFragment customImage)
+ {
+ return operations.UpdateAsync(resourceGroupName, labName, name, customImage).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Modify properties of custom images.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CustomImageFragment customImage, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, name, customImage, 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 resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// A custom image.
+ ///
+ public static CustomImage BeginCreateOrUpdate(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CustomImage customImage)
+ {
+ return operations.BeginCreateOrUpdateAsync(resourceGroupName, 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 resource group.
+ ///
+ ///
+ /// 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 resourceGroupName, string labName, string name, CustomImage customImage, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, customImage, null, cancellationToken).ConfigureAwait(false))
+ {
+ 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 resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ public static void BeginDelete(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name)
+ {
+ operations.BeginDeleteAsync(resourceGroupName, 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 resource group.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the custom image.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginDeleteAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, 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 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
new file mode 100644
index 000000000000..806b878deb1d
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DevTestLabsClient.cs
@@ -0,0 +1,504 @@
+//
+// 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
+{
+ 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
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ public System.Uri BaseUri { get; set; }
+
+ ///
+ /// Gets or sets json serialization settings.
+ ///
+ public JsonSerializerSettings SerializationSettings { get; private set; }
+
+ ///
+ /// Gets or sets json deserialization settings.
+ ///
+ public JsonSerializerSettings DeserializationSettings { get; private set; }
+
+ ///
+ /// Credentials needed for the client to connect to Azure.
+ ///
+ public ServiceClientCredentials Credentials { get; private set; }
+
+ ///
+ /// Client API version.
+ ///
+ public string ApiVersion { get; private set; }
+
+ ///
+ /// The subscription ID.
+ ///
+ public string SubscriptionId { get; set; }
+
+ ///
+ /// The preferred language for the response.
+ ///
+ public string AcceptLanguage { get; set; }
+
+ ///
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
+ ///
+ public int? LongRunningOperationRetryTimeout { get; set; }
+
+ ///
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
+ ///
+ public bool? GenerateClientRequestId { get; set; }
+
+ ///
+ /// Gets the IProviderOperations.
+ ///
+ public virtual IProviderOperations ProviderOperations { get; private set; }
+
+ ///
+ /// Gets the ILabsOperations.
+ ///
+ public virtual ILabsOperations Labs { get; private set; }
+
+ ///
+ /// Gets the IOperations.
+ ///
+ public virtual IOperations Operations { get; private set; }
+
+ ///
+ /// Gets the IGlobalSchedulesOperations.
+ ///
+ public virtual IGlobalSchedulesOperations GlobalSchedules { get; private set; }
+
+ ///
+ /// Gets the IArtifactSourcesOperations.
+ ///
+ public virtual IArtifactSourcesOperations ArtifactSources { get; private set; }
+
+ ///
+ /// Gets the IArmTemplatesOperations.
+ ///
+ public virtual IArmTemplatesOperations ArmTemplates { get; private set; }
+
+ ///
+ /// Gets the IArtifactsOperations.
+ ///
+ public virtual IArtifactsOperations Artifacts { get; private set; }
+
+ ///
+ /// Gets the ICostsOperations.
+ ///
+ public virtual ICostsOperations Costs { get; private set; }
+
+ ///
+ /// Gets the ICustomImagesOperations.
+ ///
+ public virtual ICustomImagesOperations CustomImages { get; private set; }
+
+ ///
+ /// Gets the IFormulasOperations.
+ ///
+ public virtual IFormulasOperations Formulas { get; private set; }
+
+ ///
+ /// Gets the IGalleryImagesOperations.
+ ///
+ public virtual IGalleryImagesOperations GalleryImages { get; private set; }
+
+ ///
+ /// Gets the INotificationChannelsOperations.
+ ///
+ public virtual INotificationChannelsOperations NotificationChannels { get; private set; }
+
+ ///
+ /// Gets the IPolicySetsOperations.
+ ///
+ public virtual IPolicySetsOperations PolicySets { get; private set; }
+
+ ///
+ /// Gets the IPoliciesOperations.
+ ///
+ public virtual IPoliciesOperations Policies { get; private set; }
+
+ ///
+ /// Gets the ISchedulesOperations.
+ ///
+ public virtual ISchedulesOperations Schedules { get; private set; }
+
+ ///
+ /// Gets the IServiceRunnersOperations.
+ ///
+ public virtual IServiceRunnersOperations ServiceRunners { get; private set; }
+
+ ///
+ /// Gets the IUsersOperations.
+ ///
+ public virtual IUsersOperations Users { get; private set; }
+
+ ///
+ /// Gets the IDisksOperations.
+ ///
+ public virtual IDisksOperations Disks { get; private set; }
+
+ ///
+ /// Gets the IEnvironmentsOperations.
+ ///
+ public virtual IEnvironmentsOperations Environments { get; private set; }
+
+ ///
+ /// Gets the ISecretsOperations.
+ ///
+ public virtual ISecretsOperations Secrets { get; private set; }
+
+ ///
+ /// Gets the IServiceFabricsOperations.
+ ///
+ public virtual IServiceFabricsOperations ServiceFabrics { get; private set; }
+
+ ///
+ /// Gets the IServiceFabricSchedulesOperations.
+ ///
+ public virtual IServiceFabricSchedulesOperations ServiceFabricSchedules { get; private set; }
+
+ ///
+ /// Gets the IVirtualMachinesOperations.
+ ///
+ public virtual IVirtualMachinesOperations VirtualMachines { get; private set; }
+
+ ///
+ /// Gets the IVirtualMachineSchedulesOperations.
+ ///
+ public virtual IVirtualMachineSchedulesOperations VirtualMachineSchedules { get; private set; }
+
+ ///
+ /// Gets the IVirtualNetworksOperations.
+ ///
+ public virtual IVirtualNetworksOperations VirtualNetworks { get; private set; }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// 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)
+ {
+ 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)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected DevTestLabsClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ protected DevTestLabsClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ protected DevTestLabsClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DevTestLabsClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling DevTestLabsClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DevTestLabsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DevTestLabsClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DevTestLabsClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DevTestLabsClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the 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)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
+ ///
+ /// Initializes client properties.
+ ///
+ private void Initialize()
+ {
+ 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);
+ ServiceFabrics = new ServiceFabricsOperations(this);
+ ServiceFabricSchedules = new ServiceFabricSchedulesOperations(this);
+ VirtualMachines = new VirtualMachinesOperations(this);
+ VirtualMachineSchedules = new VirtualMachineSchedulesOperations(this);
+ VirtualNetworks = new VirtualNetworksOperations(this);
+ BaseUri = new System.Uri("https://management.azure.com");
+ ApiVersion = "2018-09-15";
+ AcceptLanguage = "en-US";
+ LongRunningOperationRetryTimeout = 30;
+ GenerateClientRequestId = true;
+ SerializationSettings = new JsonSerializerSettings
+ {
+ Formatting = Newtonsoft.Json.Formatting.Indented,
+ DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
+ DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
+ NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
+ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
+ {
+ new Iso8601TimeSpanConverter()
+ }
+ };
+ SerializationSettings.Converters.Add(new TransformationJsonConverter());
+ DeserializationSettings = new JsonSerializerSettings
+ {
+ DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
+ DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
+ NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
+ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
+ {
+ new Iso8601TimeSpanConverter()
+ }
+ };
+ CustomInitialize();
+ DeserializationSettings.Converters.Add(new TransformationJsonConverter());
+ DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
+ }
+ }
+}
diff --git a/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs
new file mode 100644
index 000000000000..1f6e18917d74
--- /dev/null
+++ b/src/DevTestLabs/DevTestLabs.Management.Sdk/Generated/DisksOperations.cs
@@ -0,0 +1,1875 @@
+//
+// 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
+{
+ 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
+ {
+ ///