diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/ArmDevTestLabsModelFactory.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/ArmDevTestLabsModelFactory.cs index 97edfcd6beee..e9ee9acdcc3e 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/ArmDevTestLabsModelFactory.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/ArmDevTestLabsModelFactory.cs @@ -119,7 +119,7 @@ public static DevTestLabAnnouncement DevTestLabAnnouncement(string title = null, /// If the schedule will occur only some days of the week, specify the weekly recurrence. /// If the schedule will occur once each day of the week, specify the daily recurrence. /// If the schedule will occur multiple times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard time). + /// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). /// Notification settings. /// The creation date of the schedule. /// The resource ID to which the schedule belongs. @@ -370,6 +370,38 @@ public static DevTestLabResourceCost DevTestLabResourceCost(string resourceName serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The name of the virtual machine or environment. + /// The location of the new virtual machine or environment. + /// The tags of the resource. + /// The status of the schedule (i.e. Enabled, Disabled). + /// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + /// If the schedule will occur only some days of the week, specify the weekly recurrence. + /// If the schedule will occur once each day of the week, specify the daily recurrence. + /// If the schedule will occur multiple times a day, specify the hourly recurrence. + /// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). + /// Notification settings. + /// The resource ID to which the schedule belongs. + /// A new instance for mocking. + public static DevTestLabScheduleCreationParameter DevTestLabScheduleCreationParameter(string name = null, AzureLocation? location = null, IDictionary tags = null, DevTestLabEnableStatus? status = null, string taskType = null, DevTestLabWeekDetails weeklyRecurrence = null, string dailyRecurrenceTime = null, int? hourlyRecurrenceMinute = null, string timeZoneId = null, DevTestLabNotificationSettings notificationSettings = null, ResourceIdentifier targetResourceId = null) + { + tags ??= new Dictionary(); + + return new DevTestLabScheduleCreationParameter( + name, + location, + tags, + status, + taskType, + weeklyRecurrence, + dailyRecurrenceTime != null ? new DayDetails(dailyRecurrenceTime, serializedAdditionalRawData: null) : null, + hourlyRecurrenceMinute != null ? new HourDetails(hourlyRecurrenceMinute, serializedAdditionalRawData: null) : null, + timeZoneId, + notificationSettings, + targetResourceId, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -455,38 +487,6 @@ public static DevTestLabFormulaData DevTestLabFormulaData(ResourceIdentifier id serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The name of the virtual machine or environment. - /// The location of the new virtual machine or environment. - /// The tags of the resource. - /// The status of the schedule (i.e. Enabled, Disabled). - /// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). - /// If the schedule will occur only some days of the week, specify the weekly recurrence. - /// If the schedule will occur once each day of the week, specify the daily recurrence. - /// If the schedule will occur multiple times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard time). - /// Notification settings. - /// The resource ID to which the schedule belongs. - /// A new instance for mocking. - public static DevTestLabScheduleCreationParameter DevTestLabScheduleCreationParameter(string name = null, AzureLocation? location = null, IDictionary tags = null, DevTestLabEnableStatus? status = null, string taskType = null, DevTestLabWeekDetails weeklyRecurrence = null, string dailyRecurrenceTime = null, int? hourlyRecurrenceMinute = null, string timeZoneId = null, DevTestLabNotificationSettings notificationSettings = null, ResourceIdentifier targetResourceId = null) - { - tags ??= new Dictionary(); - - return new DevTestLabScheduleCreationParameter( - name, - location, - tags, - status, - taskType, - weeklyRecurrence, - dailyRecurrenceTime != null ? new DayDetails(dailyRecurrenceTime, serializedAdditionalRawData: null) : null, - hourlyRecurrenceMinute != null ? new HourDetails(hourlyRecurrenceMinute, serializedAdditionalRawData: null) : null, - timeZoneId, - notificationSettings, - targetResourceId, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -525,6 +525,14 @@ public static DevTestLabGalleryImage DevTestLabGalleryImage(ResourceIdentifier i serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The upload URI for the VHD. + /// A new instance for mocking. + public static DevTestLabGenerateUploadUriResult DevTestLabGenerateUploadUriResult(Uri uploadUri = null) + { + return new DevTestLabGenerateUploadUriResult(uploadUri, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -1063,13 +1071,5 @@ public static DevTestLabExternalSubnet DevTestLabExternalSubnet(ResourceIdentifi { return new DevTestLabExternalSubnet(id, name, serializedAdditionalRawData: null); } - - /// Initializes a new instance of . - /// The upload URI for the VHD. - /// A new instance for mocking. - public static DevTestLabGenerateUploadUriResult DevTestLabGenerateUploadUriResult(Uri uploadUri = null) - { - return new DevTestLabGenerateUploadUriResult(uploadUri, serializedAdditionalRawData: null); - } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs index 8912727eb70b..436667131ca6 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs @@ -1656,7 +1656,7 @@ public virtual Pageable GetVhds(CancellationToken cancellationToken /// /// /// - /// Specify the $expand query. Example: 'properties($select=author)'. + /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -1686,7 +1686,7 @@ public virtual AsyncPageable GetGalleryImagesAsync(strin /// /// /// - /// Specify the $expand query. Example: 'properties($select=author)'. + /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabScheduleData.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabScheduleData.cs index 0388dc264a1b..8ed87ca81b88 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabScheduleData.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabScheduleData.cs @@ -69,7 +69,7 @@ public DevTestLabScheduleData(AzureLocation location) : base(location) /// If the schedule will occur only some days of the week, specify the weekly recurrence. /// If the schedule will occur once each day of the week, specify the daily recurrence. /// If the schedule will occur multiple times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard time). + /// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). /// Notification settings. /// The creation date of the schedule. /// The resource ID to which the schedule belongs. @@ -131,7 +131,7 @@ public int? HourlyRecurrenceMinute } } - /// The time zone ID (e.g. Pacific Standard time). + /// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). public string TimeZoneId { get; set; } /// Notification settings. public DevTestLabNotificationSettings NotificationSettings { get; set; } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.Serialization.cs index e127960fa80e..c91aa1142fa9 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ArmTemplateList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ArmTemplateList DeserializeArmTemplateList(JsonElement element, return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ArmTemplateList DeserializeArmTemplateList(JsonElement element, } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ArmTemplateList DeserializeArmTemplateList(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ArmTemplateList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ArmTemplateList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.cs index 982136e39329..3ed8a61f3139 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArmTemplateList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class ArmTemplateList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ArmTemplateList() + /// The ArmTemplate items on this page. + /// is null. + internal ArmTemplateList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The ArmTemplate items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ArmTemplateList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ArmTemplateList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal ArmTemplateList() + { + } + + /// The ArmTemplate items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.Serialization.cs index d594832843d4..e6748e58ebf6 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ArtifactList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ArtifactList DeserializeArtifactList(JsonElement element, ModelR return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ArtifactList DeserializeArtifactList(JsonElement element, ModelR } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ArtifactList DeserializeArtifactList(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new ArtifactList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ArtifactList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.cs index a07695d4f5f0..57e10eb82ded 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class ArtifactList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ArtifactList() + /// The Artifact items on this page. + /// is null. + internal ArtifactList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Artifact items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ArtifactList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ArtifactList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal ArtifactList() + { + } + + /// The Artifact items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.Serialization.cs index b5718f63c903..5e7b9ae4a45c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ArtifactSourceList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ArtifactSourceList DeserializeArtifactSourceList(JsonElement ele return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ArtifactSourceList DeserializeArtifactSourceList(JsonElement ele } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ArtifactSourceList DeserializeArtifactSourceList(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new ArtifactSourceList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ArtifactSourceList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.cs index 9e103338069e..59d6ecadeb43 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ArtifactSourceList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class ArtifactSourceList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ArtifactSourceList() + /// The ArtifactSource items on this page. + /// is null. + internal ArtifactSourceList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The ArtifactSource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ArtifactSourceList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ArtifactSourceList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal ArtifactSourceList() + { + } + + /// The ArtifactSource items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.Serialization.cs index 30e2721c4fe3..3fa3f33eaa3a 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CustomImageList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static CustomImageList DeserializeCustomImageList(JsonElement element, return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static CustomImageList DeserializeCustomImageList(JsonElement element, } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static CustomImageList DeserializeCustomImageList(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new CustomImageList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new CustomImageList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.cs index 4b1ea75f9101..ae3c02dfdf15 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/CustomImageList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class CustomImageList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal CustomImageList() + /// The CustomImage items on this page. + /// is null. + internal CustomImageList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The CustomImage items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal CustomImageList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal CustomImageList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal CustomImageList() + { + } + + /// The CustomImage items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabScheduleCreationParameter.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabScheduleCreationParameter.cs index 6dda7f9ffebd..f047fd36f00d 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabScheduleCreationParameter.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabScheduleCreationParameter.cs @@ -61,7 +61,7 @@ public DevTestLabScheduleCreationParameter() /// If the schedule will occur only some days of the week, specify the weekly recurrence. /// If the schedule will occur once each day of the week, specify the daily recurrence. /// If the schedule will occur multiple times a day, specify the hourly recurrence. - /// The time zone ID (e.g. Pacific Standard time). + /// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). /// Notification settings. /// The resource ID to which the schedule belongs. /// Keeps track of any properties unknown to the library. @@ -121,7 +121,7 @@ public int? HourlyRecurrenceMinute } } - /// The time zone ID (e.g. Pacific Standard time). + /// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). public string TimeZoneId { get; set; } /// Notification settings. public DevTestLabNotificationSettings NotificationSettings { get; set; } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabStorageType.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabStorageType.cs index f2f67aded4ca..069b1271412c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabStorageType.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DevTestLabStorageType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.DevTestLabs.Models { - /// The storage type for the disk (i.e. Standard, Premium). + /// Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. public readonly partial struct DevTestLabStorageType : IEquatable { private readonly string _value; diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.Serialization.cs index efaee3feedc6..252b0dac60ae 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DiskList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static DiskList DeserializeDiskList(JsonElement element, ModelReaderWri return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static DiskList DeserializeDiskList(JsonElement element, ModelReaderWri } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DiskList DeserializeDiskList(JsonElement element, ModelReaderWri } } serializedAdditionalRawData = rawDataDictionary; - return new DiskList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DiskList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.cs index 8a76ceac4dbd..05c3de274eea 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DiskList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class DiskList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DiskList() + /// The Disk items on this page. + /// is null. + internal DiskList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Disk items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DiskList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DiskList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal DiskList() + { + } + + /// The Disk items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.Serialization.cs index 160543fdfbb0..79c21f8bb81c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DtlEnvironmentList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static DtlEnvironmentList DeserializeDtlEnvironmentList(JsonElement ele return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static DtlEnvironmentList DeserializeDtlEnvironmentList(JsonElement ele } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DtlEnvironmentList DeserializeDtlEnvironmentList(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new DtlEnvironmentList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DtlEnvironmentList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.cs index d7d19eeac19c..80a97ff7d6d4 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/DtlEnvironmentList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class DtlEnvironmentList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DtlEnvironmentList() + /// The DtlEnvironment items on this page. + /// is null. + internal DtlEnvironmentList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The DtlEnvironment items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DtlEnvironmentList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DtlEnvironmentList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal DtlEnvironmentList() + { + } + + /// The DtlEnvironment items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.Serialization.cs index 097ef6626d6e..18fe17237d3e 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(FormulaList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static FormulaList DeserializeFormulaList(JsonElement element, ModelRea return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static FormulaList DeserializeFormulaList(JsonElement element, ModelRea } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static FormulaList DeserializeFormulaList(JsonElement element, ModelRea } } serializedAdditionalRawData = rawDataDictionary; - return new FormulaList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new FormulaList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.cs index 3f7e228b3cd2..a6e17b779ec9 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/FormulaList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class FormulaList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal FormulaList() + /// The Formula items on this page. + /// is null. + internal FormulaList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Formula items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal FormulaList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal FormulaList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal FormulaList() + { + } + + /// The Formula items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.Serialization.cs index a5d647e39527..4f6233697c5d 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(GalleryImageList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static GalleryImageList DeserializeGalleryImageList(JsonElement element return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static GalleryImageList DeserializeGalleryImageList(JsonElement element } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static GalleryImageList DeserializeGalleryImageList(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new GalleryImageList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new GalleryImageList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.cs index 64e27a5e30d4..5d33aff12810 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/GalleryImageList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class GalleryImageList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal GalleryImageList() + /// The GalleryImage items on this page. + /// is null. + internal GalleryImageList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The GalleryImage items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal GalleryImageList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal GalleryImageList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal GalleryImageList() + { + } + + /// The GalleryImage items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.Serialization.cs index c0cf90c158f5..2d6a36b66e0b 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(LabList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static LabList DeserializeLabList(JsonElement element, ModelReaderWrite return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static LabList DeserializeLabList(JsonElement element, ModelReaderWrite } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static LabList DeserializeLabList(JsonElement element, ModelReaderWrite } } serializedAdditionalRawData = rawDataDictionary; - return new LabList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new LabList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.cs index 16444640dd62..7c8b0bda6601 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class LabList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal LabList() + /// The Lab items on this page. + /// is null. + internal LabList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Lab items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal LabList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LabList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal LabList() + { + } + + /// The Lab items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.Serialization.cs index 8e280df72713..c7da15d65417 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.Serialization.cs @@ -35,20 +35,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(LabVhdList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); + JsonSerializer.Serialize(writer, item); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -88,17 +85,13 @@ internal static LabVhdList DeserializeLabVhdList(JsonElement element, ModelReade return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -109,7 +102,11 @@ internal static LabVhdList DeserializeLabVhdList(JsonElement element, ModelReade } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -118,7 +115,7 @@ internal static LabVhdList DeserializeLabVhdList(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new LabVhdList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new LabVhdList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.cs index 06a31aab0ce6..101dbe6f9447 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVhdList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.DevTestLabs.Models @@ -47,25 +48,34 @@ internal partial class LabVhdList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal LabVhdList() + /// The LabVhd items on this page. + /// is null. + internal LabVhdList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The LabVhd items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal LabVhdList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LabVhdList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal LabVhdList() + { + } + + /// The LabVhd items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.Serialization.cs index f69fc190bb62..b7143a527dd6 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(LabVmList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static LabVmList DeserializeLabVmList(JsonElement element, ModelReaderW return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static LabVmList DeserializeLabVmList(JsonElement element, ModelReaderW } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static LabVmList DeserializeLabVmList(JsonElement element, ModelReaderW } } serializedAdditionalRawData = rawDataDictionary; - return new LabVmList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new LabVmList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.cs index 3a523c69db1b..dd7bb7e65f03 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/LabVmList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class LabVmList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal LabVmList() + /// The LabVirtualMachine items on this page. + /// is null. + internal LabVmList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The LabVirtualMachine items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal LabVmList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LabVmList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal LabVmList() + { + } + + /// The LabVirtualMachine items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.Serialization.cs index 21e985a55037..dad9e270d56f 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NotificationChannelList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static NotificationChannelList DeserializeNotificationChannelList(JsonE return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NotificationChannelList DeserializeNotificationChannelList(JsonE } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NotificationChannelList DeserializeNotificationChannelList(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new NotificationChannelList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NotificationChannelList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.cs index 1f92d5ba8543..729af3081ea1 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/NotificationChannelList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class NotificationChannelList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NotificationChannelList() + /// The NotificationChannel items on this page. + /// is null. + internal NotificationChannelList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The NotificationChannel items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NotificationChannelList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NotificationChannelList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal NotificationChannelList() + { + } + + /// The NotificationChannel items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.Serialization.cs index 9ab950c8af12..a29a45b52793 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PolicyList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static PolicyList DeserializePolicyList(JsonElement element, ModelReade return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static PolicyList DeserializePolicyList(JsonElement element, ModelReade } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static PolicyList DeserializePolicyList(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new PolicyList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new PolicyList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.cs index e1436379cbb5..306ee1a7eb07 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/PolicyList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class PolicyList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal PolicyList() + /// The Policy items on this page. + /// is null. + internal PolicyList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Policy items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal PolicyList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal PolicyList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal PolicyList() + { + } + + /// The Policy items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.Serialization.cs index f72a4ac114e4..c269c6a5cb6a 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ScheduleList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ScheduleList DeserializeScheduleList(JsonElement element, ModelR return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ScheduleList DeserializeScheduleList(JsonElement element, ModelR } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ScheduleList DeserializeScheduleList(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new ScheduleList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ScheduleList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.cs index 29f840eefddb..7136a672481c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ScheduleList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class ScheduleList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ScheduleList() + /// The Schedule items on this page. + /// is null. + internal ScheduleList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Schedule items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ScheduleList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ScheduleList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal ScheduleList() + { + } + + /// The Schedule items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.Serialization.cs index 7f17a6254772..02f6cab7fcb3 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SecretList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static SecretList DeserializeSecretList(JsonElement element, ModelReade return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static SecretList DeserializeSecretList(JsonElement element, ModelReade } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static SecretList DeserializeSecretList(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new SecretList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new SecretList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.cs index 12488a687cad..053c2df5b60f 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/SecretList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class SecretList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SecretList() + /// The Secret items on this page. + /// is null. + internal SecretList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The Secret items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal SecretList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal SecretList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal SecretList() + { + } + + /// The Secret items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.Serialization.cs index 821915ffa2aa..c97ef705a7db 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceFabricList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ServiceFabricList DeserializeServiceFabricList(JsonElement eleme return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ServiceFabricList DeserializeServiceFabricList(JsonElement eleme } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ServiceFabricList DeserializeServiceFabricList(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceFabricList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ServiceFabricList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.cs index 70e3687864bd..1cbfc606ee02 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/ServiceFabricList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class ServiceFabricList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ServiceFabricList() + /// The ServiceFabric items on this page. + /// is null. + internal ServiceFabricList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The ServiceFabric items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ServiceFabricList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ServiceFabricList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal ServiceFabricList() + { + } + + /// The ServiceFabric items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.Serialization.cs index ea1a99428f9d..c994abf51cfb 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(UserList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static UserList DeserializeUserList(JsonElement element, ModelReaderWri return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static UserList DeserializeUserList(JsonElement element, ModelReaderWri } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static UserList DeserializeUserList(JsonElement element, ModelReaderWri } } serializedAdditionalRawData = rawDataDictionary; - return new UserList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new UserList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.cs index 39f7ffa3a381..6bd4a8a6284b 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/UserList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class UserList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal UserList() + /// The User items on this page. + /// is null. + internal UserList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The User items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal UserList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal UserList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal UserList() + { + } + + /// The User items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.Serialization.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.Serialization.cs index 91f8e87fa9fe..38f053433c26 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.Serialization.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(VirtualNetworkList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static VirtualNetworkList DeserializeVirtualNetworkList(JsonElement ele return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static VirtualNetworkList DeserializeVirtualNetworkList(JsonElement ele } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static VirtualNetworkList DeserializeVirtualNetworkList(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new VirtualNetworkList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new VirtualNetworkList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.cs index 7872f189bc25..ec8355755548 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Models/VirtualNetworkList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DevTestLabs.Models { @@ -46,25 +47,34 @@ internal partial class VirtualNetworkList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal VirtualNetworkList() + /// The VirtualNetwork items on this page. + /// is null. + internal VirtualNetworkList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of the list operation. - /// Link for next set of results. + /// The VirtualNetwork items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal VirtualNetworkList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal VirtualNetworkList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of the list operation. + /// Initializes a new instance of for deserialization. + internal VirtualNetworkList() + { + } + + /// The VirtualNetwork items on this page. public IReadOnlyList Value { get; } - /// Link for next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArmTemplatesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArmTemplatesRestOperations.cs index 78f9cf793245..367aebff006f 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArmTemplatesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArmTemplatesRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/artifactsources/", false); uri.AppendPath(artifactSourceName, true); uri.AppendPath("/armtemplates", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/artifactsources/", false); uri.AppendPath(artifactSourceName, true); uri.AppendPath("/armtemplates", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,8 +109,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List azure resource manager templates in a given artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. @@ -144,8 +144,8 @@ public async Task> ListAsync(string subscriptionId, st } /// List azure resource manager templates in a given artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(artifactSourceName, true); uri.AppendPath("/armtemplates/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(artifactSourceName, true); uri.AppendPath("/armtemplates/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,8 +229,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get azure resource manager template. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// The name of the azure resource manager template. @@ -265,8 +265,8 @@ public async Task> GetAsync(string subscript } /// Get azure resource manager template. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// The name of the azure resource manager template. @@ -324,8 +324,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List azure resource manager templates in a given artifact source. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. @@ -361,8 +361,8 @@ public async Task> ListNextPageAsync(string nextLink, /// List azure resource manager templates in a given artifact source. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactSourcesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactSourcesRestOperations.cs index a35d8e781313..f70ae6ee322d 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactSourcesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactSourcesRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/artifactsources", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/artifactsources", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List artifact sources in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscriptionId, } /// List artifact sources in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/artifactsources/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/artifactsources/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string subscr } /// Get artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Properties of an artifact source. @@ -361,8 +361,8 @@ public async Task> CreateOrUpdateAsync(st } /// Create or replace an existing artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Properties of an artifact source. @@ -394,7 +394,7 @@ public Response CreateOrUpdate(string subscription } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -410,11 +410,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -428,65 +428,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete artifact source. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of artifact sources. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. + /// Properties of an artifact source. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabArtifactSourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabArtifactSourceData.DeserializeDevTestLabArtifactSourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete artifact source. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of artifact sources. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. + /// Properties of an artifact source. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabArtifactSourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabArtifactSourceData.DeserializeDevTestLabArtifactSourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -502,11 +518,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -520,75 +536,59 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of artifact sources. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete artifact source. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. - /// Properties of an artifact source. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabArtifactSourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabArtifactSourceData.DeserializeDevTestLabArtifactSourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of artifact sources. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete artifact source. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. - /// Properties of an artifact source. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabArtifactSourcePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabArtifactSourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabArtifactSourceData.DeserializeDevTestLabArtifactSourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -618,8 +618,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List artifact sources in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -653,8 +653,8 @@ public async Task> ListNextPageAsync(string nextLin /// List artifact sources in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactsRestOperations.cs index 7429695303fb..316e7fd031a5 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ArtifactsRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/artifactsources/", false); uri.AppendPath(artifactSourceName, true); uri.AppendPath("/artifacts", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/artifactsources/", false); uri.AppendPath(artifactSourceName, true); uri.AppendPath("/artifacts", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,8 +109,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List artifacts in a given artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=title)'. @@ -144,8 +144,8 @@ public async Task> ListAsync(string subscriptionId, strin } /// List artifacts in a given artifact source. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=title)'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(artifactSourceName, true); uri.AppendPath("/artifacts/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(artifactSourceName, true); uri.AppendPath("/artifacts/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,8 +229,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get artifact. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// The name of the artifact. @@ -265,8 +265,8 @@ public async Task> GetAsync(string subscription } /// Get artifact. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// The name of the artifact. @@ -349,8 +349,8 @@ internal HttpMessage CreateGenerateArmTemplateRequest(string subscriptionId, str } /// Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// The name of the artifact. @@ -384,8 +384,8 @@ public async Task> GenerateArmTemplateAsync( } /// Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// The name of the artifact. @@ -442,8 +442,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List artifacts in a given artifact source. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=title)'. @@ -479,8 +479,8 @@ public async Task> ListNextPageAsync(string nextLink, str /// List artifacts in a given artifact source. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=title)'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CostsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CostsRestOperations.cs index cc6fe10ac552..2be012eef6b8 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CostsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CostsRestOperations.cs @@ -47,11 +47,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/costs/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -70,11 +70,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/costs/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -82,8 +82,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get cost. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the cost. /// Specify the $expand query. Example: 'properties($expand=labCostDetails)'. @@ -116,8 +116,8 @@ public async Task> GetAsync(string subscriptionId, } /// Get cost. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the cost. /// Specify the $expand query. Example: 'properties($expand=labCostDetails)'. @@ -192,8 +192,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing cost. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the cost. /// A cost item. @@ -226,8 +226,8 @@ public async Task> CreateOrUpdateAsync(string subsc } /// Create or replace an existing cost. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the cost. /// A cost item. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CustomImagesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CustomImagesRestOperations.cs index ccf8caacf37d..43fcb8cf7cfc 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CustomImagesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/CustomImagesRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/customimages", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/customimages", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List custom images in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=vm)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscriptionId, st } /// List custom images in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=vm)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/customimages/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/customimages/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get custom image. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. /// Specify the $expand query. Example: 'properties($select=vm)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string subscript } /// Get custom image. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. /// Specify the $expand query. Example: 'properties($select=vm)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing custom image. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. /// A custom image. @@ -356,8 +356,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing custom image. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. /// A custom image. @@ -384,7 +384,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -400,11 +400,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -418,67 +418,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete custom image. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of custom images. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. + /// A custom image. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabCustomImageData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabCustomImageData.DeserializeDevTestLabCustomImageData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete custom image. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of custom images. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. + /// A custom image. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabCustomImageData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabCustomImageData.DeserializeDevTestLabCustomImageData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -494,11 +508,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -512,75 +526,61 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of custom images. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete custom image. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. - /// A custom image. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabCustomImageData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabCustomImageData.DeserializeDevTestLabCustomImageData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of custom images. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete custom image. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the custom image. - /// A custom image. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabCustomImagePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabCustomImageData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabCustomImageData.DeserializeDevTestLabCustomImageData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -610,8 +610,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List custom images in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=vm)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -645,8 +645,8 @@ public async Task> ListNextPageAsync(string nextLink, /// List custom images in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=vm)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/DisksRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/DisksRestOperations.cs index d9fb7f706a82..9d9f2b1d558c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/DisksRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/DisksRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/disks", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/disks", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,8 +109,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List disks in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=diskType)'. @@ -144,8 +144,8 @@ public async Task> ListAsync(string subscriptionId, string re } /// List disks in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=diskType)'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(userName, true); uri.AppendPath("/disks/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(userName, true); uri.AppendPath("/disks/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,8 +229,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get disk. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -265,8 +265,8 @@ public async Task> GetAsync(string subscriptionId, } /// Get disk. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -347,8 +347,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing disk. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -378,8 +378,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing disk. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -408,7 +408,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -426,11 +426,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -446,71 +446,85 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete disk. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of disks. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. + /// A Disk. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabDiskData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabDiskData.DeserializeDevTestLabDiskData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete disk. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of disks. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. + /// A Disk. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabDiskData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabDiskData.DeserializeDevTestLabDiskData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -528,11 +542,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -548,79 +562,65 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of disks. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete disk. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. - /// A Disk. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabDiskData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabDiskData.DeserializeDevTestLabDiskData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of disks. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete disk. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. - /// A Disk. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabDiskPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabDiskData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabDiskData.DeserializeDevTestLabDiskData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -675,8 +675,8 @@ internal HttpMessage CreateAttachRequest(string subscriptionId, string resourceG } /// Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -706,8 +706,8 @@ public async Task AttachAsync(string subscriptionId, string resourceGr } /// Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -785,8 +785,8 @@ internal HttpMessage CreateDetachRequest(string subscriptionId, string resourceG } /// Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -816,8 +816,8 @@ public async Task DetachAsync(string subscriptionId, string resourceGr } /// Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the disk. @@ -870,8 +870,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List disks in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=diskType)'. @@ -907,8 +907,8 @@ public async Task> ListNextPageAsync(string nextLink, string /// List disks in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=diskType)'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/EnvironmentsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/EnvironmentsRestOperations.cs index 82df47a7b103..474cfa3737ec 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/EnvironmentsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/EnvironmentsRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/environments", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/environments", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,8 +109,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List environments in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=deploymentProperties)'. @@ -144,8 +144,8 @@ public async Task> ListAsync(string subscriptionId, } /// List environments in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=deploymentProperties)'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(userName, true); uri.AppendPath("/environments/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(userName, true); uri.AppendPath("/environments/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,8 +229,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get environment. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. @@ -265,8 +265,8 @@ public async Task> GetAsync(string subscript } /// Get environment. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. @@ -347,8 +347,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing environment. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. @@ -378,8 +378,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing environment. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. @@ -408,7 +408,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -426,11 +426,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -446,71 +446,85 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete environment. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of environments. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. + /// An environment, which is essentially an ARM template deployment. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabEnvironmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabEnvironmentData.DeserializeDevTestLabEnvironmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete environment. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of environments. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. + /// An environment, which is essentially an ARM template deployment. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabEnvironmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabEnvironmentData.DeserializeDevTestLabEnvironmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -528,11 +542,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -548,79 +562,65 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of environments. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete environment. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. - /// An environment, which is essentially an ARM template deployment. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabEnvironmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabEnvironmentData.DeserializeDevTestLabEnvironmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of environments. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete environment. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the environment. - /// An environment, which is essentially an ARM template deployment. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabEnvironmentPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabEnvironmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabEnvironmentData.DeserializeDevTestLabEnvironmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -650,8 +650,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List environments in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=deploymentProperties)'. @@ -687,8 +687,8 @@ public async Task> ListNextPageAsync(string nextLin /// List environments in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=deploymentProperties)'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/FormulasRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/FormulasRestOperations.cs index cb00cf8434d5..c310f2f9b7d2 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/FormulasRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/FormulasRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/formulas", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/formulas", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List formulas in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscriptionId, string } /// List formulas in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/formulas/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/formulas/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get formula. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. /// Specify the $expand query. Example: 'properties($select=description)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string subscriptionI } /// Get formula. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. /// Specify the $expand query. Example: 'properties($select=description)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing formula. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. /// A formula for creating a VM, specifying an image base and other parameters. @@ -356,8 +356,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing formula. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. /// A formula for creating a VM, specifying an image base and other parameters. @@ -384,7 +384,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -400,11 +400,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -418,65 +418,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete formula. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of formulas. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. + /// A formula for creating a VM, specifying an image base and other parameters. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabFormulaData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabFormulaData.DeserializeDevTestLabFormulaData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete formula. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of formulas. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. + /// A formula for creating a VM, specifying an image base and other parameters. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabFormulaData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabFormulaData.DeserializeDevTestLabFormulaData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -492,11 +508,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -510,75 +526,59 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of formulas. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete formula. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. - /// A formula for creating a VM, specifying an image base and other parameters. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabFormulaData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabFormulaData.DeserializeDevTestLabFormulaData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of formulas. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete formula. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the formula. - /// A formula for creating a VM, specifying an image base and other parameters. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabFormulaPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabFormulaData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabFormulaData.DeserializeDevTestLabFormulaData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -608,8 +608,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List formulas in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -643,8 +643,8 @@ public async Task> ListNextPageAsync(string nextLink, stri /// List formulas in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GalleryImagesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GalleryImagesRestOperations.cs index 4931cb684bbe..d18df094075d 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GalleryImagesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GalleryImagesRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/galleryimages", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/galleryimages", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,10 +105,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List gallery images in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. - /// Specify the $expand query. Example: 'properties($select=author)'. + /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -138,10 +138,10 @@ public async Task> ListAsync(string subscriptionId, s } /// List gallery images in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. - /// Specify the $expand query. Example: 'properties($select=author)'. + /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -194,10 +194,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List gallery images in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. - /// Specify the $expand query. Example: 'properties($select=author)'. + /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. @@ -229,10 +229,10 @@ public async Task> ListNextPageAsync(string nextLink, /// List gallery images in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. - /// Specify the $expand query. Example: 'properties($select=author)'. + /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GlobalSchedulesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GlobalSchedulesRestOperations.cs index a03fb772f927..ae7e1d695ecf 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GlobalSchedulesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/GlobalSchedulesRestOperations.cs @@ -43,6 +43,7 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.DevTestLab/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -59,7 +60,6 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -73,6 +73,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.DevTestLab/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -89,7 +90,6 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -97,7 +97,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri } /// List schedules in a subscription. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -126,7 +126,7 @@ public async Task> ListBySubscriptionAsync(string subscri } /// List schedules in a subscription. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -163,6 +163,7 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -179,7 +180,6 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -195,6 +195,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -211,7 +212,6 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -219,8 +219,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// List schedules in a resource group. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -250,8 +250,8 @@ public async Task> ListByResourceGroupAsync(string subscr } /// List schedules in a resource group. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -290,11 +290,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -311,11 +311,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -323,8 +323,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -355,8 +355,8 @@ public async Task> GetAsync(string subscription } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -425,8 +425,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -457,8 +457,8 @@ public async Task> CreateOrUpdateAsync(string s } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -488,7 +488,7 @@ public Response CreateOrUpdate(string subscriptionId, st } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -502,11 +502,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -518,61 +518,77 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -586,11 +602,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -602,71 +618,55 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -709,8 +709,8 @@ internal HttpMessage CreateExecuteRequest(string subscriptionId, string resource } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// The cancellation token to use. /// , or is null. @@ -734,8 +734,8 @@ public async Task ExecuteAsync(string subscriptionId, string resourceG } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// The cancellation token to use. /// , or is null. @@ -799,8 +799,8 @@ internal HttpMessage CreateRetargetRequest(string subscriptionId, string resourc } /// Updates a schedule's target resource Id. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// Properties for retargeting a virtual machine schedule. /// The cancellation token to use. @@ -826,8 +826,8 @@ public async Task RetargetAsync(string subscriptionId, string resource } /// Updates a schedule's target resource Id. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the schedule. /// Properties for retargeting a virtual machine schedule. /// The cancellation token to use. @@ -876,7 +876,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// List schedules in a subscription. /// The URL to the next page of results. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -907,7 +907,7 @@ public async Task> ListBySubscriptionNextPageAsync(string /// List schedules in a subscription. /// The URL to the next page of results. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -960,8 +960,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// List schedules in a resource group. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -993,8 +993,8 @@ public async Task> ListByResourceGroupNextPageAsync(strin /// List schedules in a resource group. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/LabsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/LabsRestOperations.cs index 84ddccb486b3..1a2d4a4774df 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/LabsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/LabsRestOperations.cs @@ -43,6 +43,7 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.DevTestLab/labs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -59,7 +60,6 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -73,6 +73,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.DevTestLab/labs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -89,7 +90,6 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -97,7 +97,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri } /// List labs in a subscription. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -126,7 +126,7 @@ public async Task> ListBySubscriptionAsync(string subscription } /// List labs in a subscription. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -163,6 +163,7 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/labs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -179,7 +180,6 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -195,6 +195,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/labs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -211,7 +212,6 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -219,8 +219,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// List labs in a resource group. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -250,8 +250,8 @@ public async Task> ListByResourceGroupAsync(string subscriptio } /// List labs in a resource group. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -290,11 +290,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -311,11 +311,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -323,8 +323,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The cancellation token to use. @@ -355,8 +355,8 @@ public async Task> GetAsync(string subscriptionId, stri } /// Get lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The cancellation token to use. @@ -425,8 +425,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// A lab. /// The cancellation token to use. @@ -452,8 +452,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// A lab. /// The cancellation token to use. @@ -478,7 +478,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -492,11 +492,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -508,63 +508,77 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of labs. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. + /// A lab. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabData.DeserializeDevTestLabData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of labs. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. + /// A lab. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabData.DeserializeDevTestLabData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -578,11 +592,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -594,71 +608,57 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of labs. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete lab. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. - /// A lab. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabData.DeserializeDevTestLabData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of labs. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete lab. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. - /// A lab. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string name, DevTestLabPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabData.DeserializeDevTestLabData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -701,8 +701,8 @@ internal HttpMessage CreateClaimAnyVmRequest(string subscriptionId, string resou } /// Claim a random claimable virtual machine in the lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The cancellation token to use. /// , or is null. @@ -726,8 +726,8 @@ public async Task ClaimAnyVmAsync(string subscriptionId, string resour } /// Claim a random claimable virtual machine in the lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The cancellation token to use. /// , or is null. @@ -791,8 +791,8 @@ internal HttpMessage CreateCreateEnvironmentRequest(string subscriptionId, strin } /// Create virtual machines in a lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Properties for creating a virtual machine. /// The cancellation token to use. @@ -818,8 +818,8 @@ public async Task CreateEnvironmentAsync(string subscriptionId, string } /// Create virtual machines in a lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Properties for creating a virtual machine. /// The cancellation token to use. @@ -885,8 +885,8 @@ internal HttpMessage CreateExportResourceUsageRequest(string subscriptionId, str } /// Exports the lab resource usage into a storage account This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The parameters of the export operation. /// The cancellation token to use. @@ -912,8 +912,8 @@ public async Task ExportResourceUsageAsync(string subscriptionId, stri } /// Exports the lab resource usage into a storage account This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The parameters of the export operation. /// The cancellation token to use. @@ -979,8 +979,8 @@ internal HttpMessage CreateGenerateUploadUriRequest(string subscriptionId, strin } /// Generate a URI for uploading custom disk images to a Lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Properties for generating an upload URI. /// The cancellation token to use. @@ -1010,8 +1010,8 @@ public async Task> GenerateUploadUri } /// Generate a URI for uploading custom disk images to a Lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Properties for generating an upload URI. /// The cancellation token to use. @@ -1081,8 +1081,8 @@ internal HttpMessage CreateImportVmRequest(string subscriptionId, string resourc } /// Import a virtual machine into a different lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// This represents the payload required to import a virtual machine from a different lab into the current one. /// The cancellation token to use. @@ -1108,8 +1108,8 @@ public async Task ImportVmAsync(string subscriptionId, string resource } /// Import a virtual machine into a different lab. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// This represents the payload required to import a virtual machine from a different lab into the current one. /// The cancellation token to use. @@ -1171,8 +1171,8 @@ internal HttpMessage CreateListVhdsRequest(string subscriptionId, string resourc } /// List disk images available for custom image creation. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The cancellation token to use. /// , or is null. @@ -1200,8 +1200,8 @@ public async Task> ListVhdsAsync(string subscriptionId, str } /// List disk images available for custom image creation. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The cancellation token to use. /// , or is null. @@ -1252,7 +1252,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// List labs in a subscription. /// The URL to the next page of results. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -1283,7 +1283,7 @@ public async Task> ListBySubscriptionNextPageAsync(string next /// List labs in a subscription. /// The URL to the next page of results. - /// The subscription ID. + /// The ID of the target subscription. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -1336,8 +1336,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// List labs in a resource group. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -1369,8 +1369,8 @@ public async Task> ListByResourceGroupNextPageAsync(string nex /// List labs in a resource group. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -1424,8 +1424,8 @@ internal HttpMessage CreateListVhdsNextPageRequest(string nextLink, string subsc /// List disk images available for custom image creation. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The cancellation token to use. /// , , or is null. @@ -1455,8 +1455,8 @@ public async Task> ListVhdsNextPageAsync(string nextLink, s /// List disk images available for custom image creation. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/NotificationChannelsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/NotificationChannelsRestOperations.cs index 88582ec8320f..49596ca1e8cf 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/NotificationChannelsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/NotificationChannelsRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/notificationchannels", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/notificationchannels", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List notification channels in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscripti } /// List notification channels in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/notificationchannels/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/notificationchannels/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get notification channel. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string s } /// Get notification channel. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing notification channel. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. /// A notification. @@ -361,8 +361,8 @@ public async Task> CreateOrUpdateAsy } /// Create or replace an existing notification channel. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. /// A notification. @@ -394,7 +394,7 @@ public Response CreateOrUpdate(string subscri } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -410,11 +410,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -428,65 +428,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete notification channel. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of notification channels. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. + /// A notification. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabNotificationChannelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabNotificationChannelData.DeserializeDevTestLabNotificationChannelData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete notification channel. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of notification channels. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. + /// A notification. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabNotificationChannelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabNotificationChannelData.DeserializeDevTestLabNotificationChannelData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -502,11 +518,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -520,75 +536,59 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of notification channels. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete notification channel. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. - /// A notification. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabNotificationChannelData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabNotificationChannelData.DeserializeDevTestLabNotificationChannelData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of notification channels. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete notification channel. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. - /// A notification. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabNotificationChannelPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabNotificationChannelData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabNotificationChannelData.DeserializeDevTestLabNotificationChannelData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -639,8 +639,8 @@ internal HttpMessage CreateNotifyRequest(string subscriptionId, string resourceG } /// Send notification to provided channel. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. /// Properties for generating a Notification. @@ -667,8 +667,8 @@ public async Task NotifyAsync(string subscriptionId, string resourceGr } /// Send notification to provided channel. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the notification channel. /// Properties for generating a Notification. @@ -718,8 +718,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List notification channels in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -753,8 +753,8 @@ public async Task> ListNextPageAsync(string ne /// List notification channels in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PoliciesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PoliciesRestOperations.cs index 7b23f485469b..287597a200eb 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PoliciesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PoliciesRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/policysets/", false); uri.AppendPath(policySetName, true); uri.AppendPath("/policies", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/policysets/", false); uri.AppendPath(policySetName, true); uri.AppendPath("/policies", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,9 +109,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List policies in a given policy set. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -144,9 +144,9 @@ public async Task> ListAsync(string subscriptionId, string } /// List policies in a given policy set. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(policySetName, true); uri.AppendPath("/policies/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(policySetName, true); uri.AppendPath("/policies/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,9 +229,9 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get policy. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. /// Specify the $expand query. Example: 'properties($select=description)'. @@ -265,9 +265,9 @@ public async Task> GetAsync(string subscriptionId } /// Get policy. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. /// Specify the $expand query. Example: 'properties($select=description)'. @@ -347,9 +347,9 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing policy. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. /// A Policy. @@ -383,9 +383,9 @@ public async Task> CreateOrUpdateAsync(string sub } /// Create or replace an existing policy. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. /// A Policy. @@ -418,7 +418,7 @@ public Response CreateOrUpdate(string subscriptionId, stri } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -436,11 +436,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -456,69 +456,85 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete policy. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Allows modifying tags of policies. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. + /// A Policy. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(policySetName, nameof(policySetName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, policySetName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, policySetName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabPolicyData.DeserializeDevTestLabPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete policy. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Allows modifying tags of policies. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. + /// A Policy. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(policySetName, nameof(policySetName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, policySetName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, policySetName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabPolicyData.DeserializeDevTestLabPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -536,11 +552,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -556,79 +572,63 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of policies. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Delete policy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. - /// A Policy. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(policySetName, nameof(policySetName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, policySetName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, policySetName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabPolicyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabPolicyData.DeserializeDevTestLabPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of policies. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Delete policy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// The name of the policy. - /// A Policy. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, DevTestLabPolicyPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string policySetName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(policySetName, nameof(policySetName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, policySetName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, policySetName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabPolicyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabPolicyData.DeserializeDevTestLabPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -658,9 +658,9 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List policies in a given policy set. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -695,9 +695,9 @@ public async Task> ListNextPageAsync(string nextLink, strin /// List policies in a given policy set. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the policy set. /// Specify the $expand query. Example: 'properties($select=description)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PolicySetsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PolicySetsRestOperations.cs index 852c53dbfc41..17477f2f208e 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PolicySetsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/PolicySetsRestOperations.cs @@ -81,8 +81,8 @@ internal HttpMessage CreateEvaluatePoliciesRequest(string subscriptionId, string } /// Evaluates lab policy. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the policy set. /// Request body for evaluating a policy set. @@ -114,8 +114,8 @@ public async Task> EvaluatePoliciesAs } /// Evaluates lab policy. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the policy set. /// Request body for evaluating a policy set. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SchedulesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SchedulesRestOperations.cs index 43ba8d6f0cae..3b4a460be924 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SchedulesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SchedulesRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,9 +105,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List schedules in a given lab. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -138,9 +138,9 @@ public async Task> ListAsync(string subscriptionId, strin } /// List schedules in a given lab. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,9 +217,9 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -251,9 +251,9 @@ public async Task> GetAsync(string subscription } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -327,9 +327,9 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -361,9 +361,9 @@ public async Task> CreateOrUpdateAsync(string s } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -394,7 +394,7 @@ public Response CreateOrUpdate(string subscriptionId, st } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -410,11 +410,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -428,65 +428,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -502,11 +518,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -520,75 +536,59 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -635,9 +635,9 @@ internal HttpMessage CreateExecuteRequest(string subscriptionId, string resource } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// The cancellation token to use. /// , , or is null. @@ -662,9 +662,9 @@ public async Task ExecuteAsync(string subscriptionId, string resourceG } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// The cancellation token to use. /// , , or is null. @@ -729,9 +729,9 @@ internal HttpMessage CreateListApplicableRequest(string subscriptionId, string r } /// Lists all applicable schedules. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// The cancellation token to use. /// , , or is null. @@ -760,9 +760,9 @@ public async Task> ListApplicableAsync(string subscriptio } /// Lists all applicable schedules. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// The cancellation token to use. /// , , or is null. @@ -814,9 +814,9 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List schedules in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -849,9 +849,9 @@ public async Task> ListNextPageAsync(string nextLink, str /// List schedules in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -906,9 +906,9 @@ internal HttpMessage CreateListApplicableNextPageRequest(string nextLink, string /// Lists all applicable schedules. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// The cancellation token to use. /// , , , or is null. @@ -939,9 +939,9 @@ public async Task> ListApplicableNextPageAsync(string nex /// Lists all applicable schedules. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. /// The name of the schedule. /// The cancellation token to use. /// , , , or is null. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SecretsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SecretsRestOperations.cs index aead3e3b96ed..4c28681a24fc 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SecretsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/SecretsRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/secrets", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/secrets", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,8 +109,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List secrets in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=value)'. @@ -144,8 +144,8 @@ public async Task> ListAsync(string subscriptionId, string } /// List secrets in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=value)'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(userName, true); uri.AppendPath("/secrets/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(userName, true); uri.AppendPath("/secrets/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,8 +229,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get secret. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. @@ -265,8 +265,8 @@ public async Task> GetAsync(string subscriptionId } /// Get secret. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. @@ -347,8 +347,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing secret. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. @@ -378,8 +378,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing secret. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. @@ -408,7 +408,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -426,11 +426,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -446,69 +446,85 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete secret. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of secrets. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. + /// A secret. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabSecretData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabSecretData.DeserializeDevTestLabSecretData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete secret. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of secrets. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. + /// A secret. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabSecretData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabSecretData.DeserializeDevTestLabSecretData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -526,11 +542,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -546,79 +562,63 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of secrets. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete secret. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. - /// A secret. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabSecretData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabSecretData.DeserializeDevTestLabSecretData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of secrets. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete secret. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the secret. - /// A secret. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabSecretPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabSecretData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabSecretData.DeserializeDevTestLabSecretData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -648,8 +648,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List secrets in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=value)'. @@ -685,8 +685,8 @@ public async Task> ListNextPageAsync(string nextLink, strin /// List secrets in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=value)'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricSchedulesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricSchedulesRestOperations.cs index bc7a27b8456f..767c0a5c40e1 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricSchedulesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricSchedulesRestOperations.cs @@ -51,6 +51,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/servicefabrics/", false); uri.AppendPath(serviceFabricName, true); uri.AppendPath("/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -67,7 +68,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -89,6 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/servicefabrics/", false); uri.AppendPath(serviceFabricName, true); uri.AppendPath("/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -105,7 +106,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -113,11 +113,11 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List schedules in a given service fabric. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -150,11 +150,11 @@ public async Task> ListAsync(string subscriptionId, strin } /// List schedules in a given service fabric. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -202,11 +202,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(serviceFabricName, true); uri.AppendPath("/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -229,11 +229,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(serviceFabricName, true); uri.AppendPath("/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -241,11 +241,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -279,11 +279,11 @@ public async Task> GetAsync(string subscription } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -367,11 +367,11 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -405,11 +405,11 @@ public async Task> CreateOrUpdateAsync(string s } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -442,7 +442,7 @@ public Response CreateOrUpdate(string subscriptionId, st } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -462,11 +462,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -484,21 +484,26 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , , , , or is null. + /// , , , , , or is null. /// , , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -506,30 +511,36 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(serviceFabricName, nameof(serviceFabricName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , , , , or is null. + /// , , , , , or is null. /// , , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -537,20 +548,25 @@ public Response Delete(string subscriptionId, string resourceGroupName, string l Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(serviceFabricName, nameof(serviceFabricName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -570,11 +586,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -592,26 +608,21 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , , , , or is null. + /// , , , , or is null. /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -619,36 +630,30 @@ public async Task> UpdateAsync(string subscript Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(serviceFabricName, nameof(serviceFabricName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , , , , or is null. + /// , , , , or is null. /// , , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string serviceFabricName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -656,19 +661,14 @@ public Response Update(string subscriptionId, string res Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(serviceFabricName, nameof(serviceFabricName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, serviceFabricName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -723,11 +723,11 @@ internal HttpMessage CreateExecuteRequest(string subscriptionId, string resource } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. /// The cancellation token to use. /// , , , , or is null. @@ -754,11 +754,11 @@ public async Task ExecuteAsync(string subscriptionId, string resourceG } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// The name of the schedule. /// The cancellation token to use. /// , , , , or is null. @@ -808,11 +808,11 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List schedules in a given service fabric. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -847,11 +847,11 @@ public async Task> ListNextPageAsync(string nextLink, str /// List schedules in a given service fabric. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the user profile. - /// The name of the service fabric. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// users. + /// servicefabrics. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricsRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricsRestOperations.cs index f68eb8b19b26..496300d00bc1 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricsRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceFabricsRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/servicefabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/users/", false); uri.AppendPath(userName, true); uri.AppendPath("/servicefabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,8 +109,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List service fabrics in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. @@ -144,8 +144,8 @@ public async Task> ListAsync(string subscriptionId, } /// List service fabrics in a given user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(userName, true); uri.AppendPath("/servicefabrics/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(userName, true); uri.AppendPath("/servicefabrics/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,8 +229,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get service fabric. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -265,8 +265,8 @@ public async Task> GetAsync(string subscri } /// Get service fabric. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -347,8 +347,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing service fabric. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -378,8 +378,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing service fabric. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -408,7 +408,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -426,11 +426,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -446,71 +446,85 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete service fabric. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of service fabrics. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. + /// A Service Fabric. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabServiceFabricData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabServiceFabricData.DeserializeDevTestLabServiceFabricData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete service fabric. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of service fabrics. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. + /// A Service Fabric. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabServiceFabricData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabServiceFabricData.DeserializeDevTestLabServiceFabricData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -528,11 +542,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string userName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -548,79 +562,65 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of service fabrics. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete service fabric. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. - /// A Service Fabric. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabServiceFabricData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabServiceFabricData.DeserializeDevTestLabServiceFabricData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of service fabrics. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete service fabric. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. - /// A Service Fabric. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string userName, string name, DevTestLabServiceFabricPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(userName, nameof(userName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, userName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, userName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabServiceFabricData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabServiceFabricData.DeserializeDevTestLabServiceFabricData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -671,8 +671,8 @@ internal HttpMessage CreateListApplicableSchedulesRequest(string subscriptionId, } /// Lists the applicable start/stop schedules, if any. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -704,8 +704,8 @@ public async Task> ListApplicableSchedule } /// Lists the applicable start/stop schedules, if any. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -781,8 +781,8 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// Start a service fabric. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -810,8 +810,8 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// Start a service fabric. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -883,8 +883,8 @@ internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGro } /// Stop a service fabric This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -912,8 +912,8 @@ public async Task StopAsync(string subscriptionId, string resourceGrou } /// Stop a service fabric This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// The name of the service fabric. @@ -964,8 +964,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List service fabrics in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. @@ -1001,8 +1001,8 @@ public async Task> ListNextPageAsync(string nextLink /// List service fabrics in a given user profile. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceRunnersRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceRunnersRestOperations.cs index 3befbeb44d26..0ef8b98bc7db 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceRunnersRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/ServiceRunnersRestOperations.cs @@ -74,8 +74,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get service runner. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the service runner. /// The cancellation token to use. @@ -107,8 +107,8 @@ public async Task> GetAsync(string subscri } /// Get service runner. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the service runner. /// The cancellation token to use. @@ -182,8 +182,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing service runner. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the service runner. /// A container for a managed identity to execute DevTest lab services. @@ -216,8 +216,8 @@ public async Task> CreateOrUpdateAsync(str } /// Create or replace an existing service runner. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the service runner. /// A container for a managed identity to execute DevTest lab services. @@ -288,8 +288,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete service runner. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the service runner. /// The cancellation token to use. @@ -315,8 +315,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete service runner. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the service runner. /// The cancellation token to use. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/UsersRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/UsersRestOperations.cs index dd552122b119..5bd5667e625d 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/UsersRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/UsersRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/users", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/users", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List user profiles in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=identity)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscriptionId, string re } /// List user profiles in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=identity)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/users/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/users/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=identity)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string subscriptionId, } /// Get user profile. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=identity)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing user profile. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Profile of a lab user. @@ -356,8 +356,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing user profile. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. /// Profile of a lab user. @@ -384,7 +384,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -400,11 +400,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -418,67 +418,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete user profile. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of user profiles. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. + /// Profile of a lab user. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabUserData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabUserData.DeserializeDevTestLabUserData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete user profile. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of user profiles. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. + /// Profile of a lab user. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabUserData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabUserData.DeserializeDevTestLabUserData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -494,11 +508,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -512,75 +526,61 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of user profiles. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete user profile. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. - /// Profile of a lab user. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabUserData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabUserData.DeserializeDevTestLabUserData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of user profiles. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete user profile. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the user profile. - /// Profile of a lab user. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabUserPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabUserData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabUserData.DeserializeDevTestLabUserData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -610,8 +610,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List user profiles in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=identity)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -645,8 +645,8 @@ public async Task> ListNextPageAsync(string nextLink, string /// List user profiles in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=identity)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachineSchedulesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachineSchedulesRestOperations.cs index 1636ef085b30..cdbf93df60e4 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachineSchedulesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachineSchedulesRestOperations.cs @@ -49,6 +49,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/virtualmachines/", false); uri.AppendPath(vmName, true); uri.AppendPath("/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -65,7 +66,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -85,6 +85,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/virtualmachines/", false); uri.AppendPath(vmName, true); uri.AppendPath("/schedules", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -101,7 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -109,10 +109,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List schedules in a given virtual machine. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -144,10 +144,10 @@ public async Task> ListAsync(string subscriptionId, strin } /// List schedules in a given virtual machine. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -192,11 +192,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(vmName, true); uri.AppendPath("/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -217,11 +217,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(vmName, true); uri.AppendPath("/schedules/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -229,10 +229,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -265,10 +265,10 @@ public async Task> GetAsync(string subscription } /// Get schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. @@ -347,10 +347,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -383,10 +383,10 @@ public async Task> CreateOrUpdateAsync(string s } /// Create or replace an existing schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. /// A schedule. /// The cancellation token to use. @@ -418,7 +418,7 @@ public Response CreateOrUpdate(string subscriptionId, st } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string vmName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -436,11 +436,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string vmName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -456,69 +456,85 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(vmName, nameof(vmName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, vmName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, vmName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete schedule. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// Allows modifying tags of schedules. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. + /// A schedule. /// The cancellation token to use. - /// , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(vmName, nameof(vmName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, vmName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, vmName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + DevTestLabScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string vmName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -536,11 +552,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string vmName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -556,79 +572,63 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(vmName, nameof(vmName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, vmName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, vmName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of schedules. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// Delete schedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. - /// A schedule. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, DevTestLabSchedulePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string vmName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(vmName, nameof(vmName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, vmName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, vmName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabScheduleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabScheduleData.DeserializeDevTestLabScheduleData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -679,10 +679,10 @@ internal HttpMessage CreateExecuteRequest(string subscriptionId, string resource } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. /// The cancellation token to use. /// , , , or is null. @@ -708,10 +708,10 @@ public async Task ExecuteAsync(string subscriptionId, string resourceG } /// Execute a schedule. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// The name of the schedule. /// The cancellation token to use. /// , , , or is null. @@ -760,10 +760,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List schedules in a given virtual machine. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -797,10 +797,10 @@ public async Task> ListNextPageAsync(string nextLink, str /// List schedules in a given virtual machine. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. - /// The name of the lab. - /// The name of the virtual machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// labs. + /// virtualmachines. /// Specify the $expand query. Example: 'properties($select=status)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). /// The maximum number of resources to return from the operation. Example: '$top=10'. diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachinesRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachinesRestOperations.cs index a884c8fe12fa..7f19b601c936 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachinesRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualMachinesRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/virtualmachines", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/virtualmachines", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List virtual machines in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscriptionId, string r } /// List virtual machines in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/virtualmachines/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/virtualmachines/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get virtual machine. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string subscriptionId, st } /// Get virtual machine. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// A virtual machine. @@ -356,8 +356,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// A virtual machine. @@ -384,7 +384,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -400,11 +400,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -418,67 +418,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of virtual machines. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. + /// A virtual machine. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabVmData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabVmData.DeserializeDevTestLabVmData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of virtual machines. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. + /// A virtual machine. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabVmData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabVmData.DeserializeDevTestLabVmData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -494,11 +508,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -512,75 +526,61 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of virtual machines. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete virtual machine. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. - /// A virtual machine. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabVmData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabVmData.DeserializeDevTestLabVmData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of virtual machines. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete virtual machine. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. - /// A virtual machine. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVmPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabVmData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabVmData.DeserializeDevTestLabVmData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -631,8 +631,8 @@ internal HttpMessage CreateAddDataDiskRequest(string subscriptionId, string reso } /// Attach a new or existing data disk to virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for adding a new or existing data disk to a virtual machine. @@ -660,8 +660,8 @@ public async Task AddDataDiskAsync(string subscriptionId, string resou } /// Attach a new or existing data disk to virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for adding a new or existing data disk to a virtual machine. @@ -733,8 +733,8 @@ internal HttpMessage CreateApplyArtifactsRequest(string subscriptionId, string r } /// Apply artifacts to virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for applying artifacts to a virtual machine. @@ -762,8 +762,8 @@ public async Task ApplyArtifactsAsync(string subscriptionId, string re } /// Apply artifacts to virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for applying artifacts to a virtual machine. @@ -831,8 +831,8 @@ internal HttpMessage CreateClaimRequest(string subscriptionId, string resourceGr } /// Take ownership of an existing virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -858,8 +858,8 @@ public async Task ClaimAsync(string subscriptionId, string resourceGro } /// Take ownership of an existing virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -929,8 +929,8 @@ internal HttpMessage CreateDetachDataDiskRequest(string subscriptionId, string r } /// Detach the specified disk from the virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for detaching data disk from a virtual machine. @@ -958,8 +958,8 @@ public async Task DetachDataDiskAsync(string subscriptionId, string re } /// Detach the specified disk from the virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for detaching data disk from a virtual machine. @@ -1027,8 +1027,8 @@ internal HttpMessage CreateGetRdpFileContentsRequest(string subscriptionId, stri } /// Gets a string that represents the contents of the RDP file for the virtual machine. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1058,8 +1058,8 @@ public async Task> GetRdpFileContentsAsync(str } /// Gets a string that represents the contents of the RDP file for the virtual machine. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1129,8 +1129,8 @@ internal HttpMessage CreateListApplicableSchedulesRequest(string subscriptionId, } /// Lists the applicable start/stop schedules, if any. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1160,8 +1160,8 @@ public async Task> ListApplicableSchedule } /// Lists the applicable start/stop schedules, if any. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1231,8 +1231,8 @@ internal HttpMessage CreateRedeployRequest(string subscriptionId, string resourc } /// Redeploy a virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1258,8 +1258,8 @@ public async Task RedeployAsync(string subscriptionId, string resource } /// Redeploy a virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1329,8 +1329,8 @@ internal HttpMessage CreateResizeRequest(string subscriptionId, string resourceG } /// Resize Virtual Machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for resizing a virtual machine. @@ -1358,8 +1358,8 @@ public async Task ResizeAsync(string subscriptionId, string resourceGr } /// Resize Virtual Machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// Request body for resizing a virtual machine. @@ -1427,8 +1427,8 @@ internal HttpMessage CreateRestartRequest(string subscriptionId, string resource } /// Restart a virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1454,8 +1454,8 @@ public async Task RestartAsync(string subscriptionId, string resourceG } /// Restart a virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1521,8 +1521,8 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// Start a virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1548,8 +1548,8 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// Start a virtual machine. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1615,8 +1615,8 @@ internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGro } /// Stop a virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1642,8 +1642,8 @@ public async Task StopAsync(string subscriptionId, string resourceGrou } /// Stop a virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1709,8 +1709,8 @@ internal HttpMessage CreateTransferDisksRequest(string subscriptionId, string re } /// Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1736,8 +1736,8 @@ public async Task TransferDisksAsync(string subscriptionId, string res } /// Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1803,8 +1803,8 @@ internal HttpMessage CreateUnClaimRequest(string subscriptionId, string resource } /// Release ownership of an existing virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1830,8 +1830,8 @@ public async Task UnClaimAsync(string subscriptionId, string resourceG } /// Release ownership of an existing virtual machine This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual machine. /// The cancellation token to use. @@ -1880,8 +1880,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List virtual machines in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -1915,8 +1915,8 @@ public async Task> ListNextPageAsync(string nextLink, string /// List virtual machines in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualNetworksRestOperations.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualNetworksRestOperations.cs index d14b82cd6176..2cb24afba471 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualNetworksRestOperations.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/RestOperations/VirtualNetworksRestOperations.cs @@ -47,6 +47,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/virtualnetworks", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -63,7 +64,6 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -81,6 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.DevTestLab/labs/", false); uri.AppendPath(labName, true); uri.AppendPath("/virtualnetworks", false); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); @@ -97,7 +98,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$orderby", orderby, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -105,8 +105,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List virtual networks in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -138,8 +138,8 @@ public async Task> ListAsync(string subscriptionId, } /// List virtual networks in a given lab. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -182,11 +182,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(labName, true); uri.AppendPath("/virtualnetworks/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -205,11 +205,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(labName, true); uri.AppendPath("/virtualnetworks/", false); uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); if (expand != null) { uri.AppendQuery("$expand", expand, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -217,8 +217,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get virtual network. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. @@ -251,8 +251,8 @@ public async Task> GetAsync(string subscr } /// Get virtual network. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. @@ -327,8 +327,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace an existing virtual network. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. /// A virtual network. @@ -356,8 +356,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or replace an existing virtual network. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. /// A virtual network. @@ -384,7 +384,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -400,11 +400,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -418,67 +418,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete virtual network. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of virtual networks. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. + /// A virtual network. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabVirtualNetworkData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DevTestLabVirtualNetworkData.DeserializeDevTestLabVirtualNetworkData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete virtual network. This operation can take a while to complete. - /// The subscription ID. - /// The name of the resource group. + /// Allows modifying tags of virtual networks. All other properties will be ignored. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. + /// A virtual network. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DevTestLabVirtualNetworkData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DevTestLabVirtualNetworkData.DeserializeDevTestLabVirtualNetworkData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string labName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -494,11 +508,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string labName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -512,75 +526,61 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Allows modifying tags of virtual networks. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete virtual network. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. - /// A virtual network. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DevTestLabVirtualNetworkData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DevTestLabVirtualNetworkData.DeserializeDevTestLabVirtualNetworkData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Allows modifying tags of virtual networks. All other properties will be ignored. - /// The subscription ID. - /// The name of the resource group. + /// Delete virtual network. This operation can take a while to complete. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// The name of the virtual network. - /// A virtual network. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string labName, string name, DevTestLabVirtualNetworkPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(labName, nameof(labName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, labName, name, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, labName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DevTestLabVirtualNetworkData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DevTestLabVirtualNetworkData.DeserializeDevTestLabVirtualNetworkData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -610,8 +610,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List virtual networks in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). @@ -645,8 +645,8 @@ public async Task> ListNextPageAsync(string nextLin /// List virtual networks in a given lab. /// The URL to the next page of results. - /// The subscription ID. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the lab. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. /// The filter to apply to the operation. Example: '$filter=contains(name,'myName'). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/autorest.md b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/autorest.md index a9cb2e4d94fb..37c393e5e08f 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/autorest.md +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: DevTestLabs namespace: Azure.ResourceManager.DevTestLabs -require: https://github.com/Azure/azure-rest-api-specs/blob/6b08774c89877269e73e11ac3ecbd1bd4e14f5a0/specification/devtestlabs/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/471eab645d7bb83a4f54d283db5690f58d04a670/specification/devtestlabs/resource-manager/readme.md #tag: package-2018-09 output-folder: $(this-folder)/Generated clear-output-folder: true @@ -195,5 +195,89 @@ rename-mapping: directive: - remove-operation: ProviderOperations_List - + - from: swagger-document + where: $.definitions.ArmTemplateProperties.properties.contents + transform: > + delete $["additionalProperties"]; + - from: swagger-document + where: $.definitions.ArmTemplateInfo.properties.parameters + transform: > + delete $["additionalProperties"]; + - from: swagger-document + where: $.definitions.ParametersValueFileInfo.properties.parametersValueInfo + transform: > + delete $["additionalProperties"]; + - from: swagger-document + where: $.definitions.ArtifactProperties.properties.parameters + transform: > + delete $["additionalProperties"]; + - from: swagger-document + where: $.definitions.ArmTemplateInfo.properties.template + transform: > + delete $["additionalProperties"]; + # Bulk update for all 'name' parameters in paths + - from: swagger-document + where: $.paths[*][*].parameters[?(@.name == "name" && @.in == "path")] + transform: > + if ($["description"] && $["description"].includes("LabCost")) { + $["description"] = " The name of the cost"; + } + if ($["description"] && $["description"].includes("CustomImage")) { + $["description"] = " The name of the custom image"; + } + if ($["description"] && $["description"].includes("DtlEnvironment")) { + $["description"] = " The name of the environment"; + } + if ($["description"] && $["description"].includes("Disk")) { + $["description"] = " The name of the disk"; + } + if ($["description"] && $["description"].includes("ArtifactSource")) { + $["description"] = " The name of the artifact source"; + } + if ($["description"] && $["description"].includes("Artifact")) { + $["description"] = " The name of the artifact"; + } + if ($["description"] && $["description"].includes("ArmTemplate")) { + $["description"] = "The name of the azure resource manager template"; + } + if ($["description"] && $["description"].includes("Formula")) { + $["description"] = "The name of the formula"; + } + if ($["description"] && $["description"].includes("Schedule")) { + $["description"] = "The name of the schedule"; + } + if ($["description"] && $["description"].includes("NotificationChannel")) { + $["description"] = "The name of the notification channel"; + } + if ($["description"] && $["description"].includes("LabVirtualMachine")) { + $["description"] = "The name of the virtual machine"; + } + if ($["description"] && $["description"].includes("VirtualNetwork")) { + $["description"] = "The name of the virtual network"; + } + if ($["description"] && $["description"].includes("Secret")) { + $["description"] = "The name of the secret"; + } + if ($["description"] && $["description"].includes("ServiceFabric")) { + $["description"] = "The name of the service fabric"; + } + if ($["description"] && $["description"].includes("User")) { + $["description"] = "The name of the user profile"; + } + if ($["description"] && $["description"].includes("ServiceRunner")) { + $["description"] = "The name of the service runner"; + } + if ($["description"] && $["description"].includes("PolicySet")) { + $["description"] = "The name of the policy set"; + } + # Fix policySetName parameter specifically + - from: swagger-document + where: $.paths[*][*].parameters[?(@.name == "policySetName")] + transform: > + $["description"] = "The name of the policy set"; + # Fix specific policy name parameter + - from: swagger-document + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}"][*].parameters[?(@.name == "name")] + transform: > + $["description"] = "The name of the policy"; ``` diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabDiskResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabDiskResource.cs index 4c1fbbad487d..670c4199584c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabDiskResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabDiskResource.cs @@ -65,7 +65,7 @@ public async Task Delete_DisksDelete() string subscriptionId = "{subscriptionId}"; string resourceGroupName = "resourceGroupName"; string labName = "{labName}"; - string userName = "{userId}"; + string userName = "@me"; string name = "{diskName}"; ResourceIdentifier devTestLabDiskResourceId = DevTestLabDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName, userName, name); DevTestLabDiskResource devTestLabDisk = client.GetDevTestLabDiskResource(devTestLabDiskResourceId); diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabVirtualNetworkCollection.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabVirtualNetworkCollection.cs index f70011bbacb9..68e3983360f5 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabVirtualNetworkCollection.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Generated/Samples/Sample_DevTestLabVirtualNetworkCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.DevTestLabs.Models; using NUnit.Framework; namespace Azure.ResourceManager.DevTestLabs.Samples @@ -42,6 +43,12 @@ public async Task CreateOrUpdate_VirtualNetworksCreateOrUpdate() string name = "{virtualNetworkName}"; DevTestLabVirtualNetworkData data = new DevTestLabVirtualNetworkData(new AzureLocation("{location}")) { + AllowedSubnets = {new DevTestLabSubnet +{ +ResourceId = new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet"), +LabSubnetName = "{virtualNetworkName}Subnet", +AllowPublicIP = DevTestLabUsagePermissionType.Allow, +}}, Tags = { ["tagName1"] = "tagValue1"