diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceGroupResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceGroupResource.cs index 659fb7a7789f1..790357ea7880a 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceGroupResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceGroupResource.cs @@ -51,13 +51,13 @@ public async Task Get_DeviceGroupsGet() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // DeviceGroups_Delete + // DeviceGroups_Update [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeviceGroupsDelete() + public async Task Update_DeviceGroupsUpdate() { - // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json - // this example is just showing the usage of "DeviceGroups_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json + // this example is just showing the usage of "DeviceGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -75,18 +75,24 @@ public async Task Delete_DeviceGroupsDelete() SphereDeviceGroupResource sphereDeviceGroup = client.GetSphereDeviceGroupResource(sphereDeviceGroupResourceId); // invoke the operation - await sphereDeviceGroup.DeleteAsync(WaitUntil.Completed); + SphereDeviceGroupPatch patch = new SphereDeviceGroupPatch(); + ArmOperation lro = await sphereDeviceGroup.UpdateAsync(WaitUntil.Completed, patch); + SphereDeviceGroupResource result = lro.Value; - Console.WriteLine($"Succeeded"); + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SphereDeviceGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // DeviceGroups_Update + // DeviceGroups_Delete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_DeviceGroupsUpdate() + public async Task Delete_DeviceGroupsDelete() { - // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json - // this example is just showing the usage of "DeviceGroups_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json + // this example is just showing the usage of "DeviceGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -104,15 +110,9 @@ public async Task Update_DeviceGroupsUpdate() SphereDeviceGroupResource sphereDeviceGroup = client.GetSphereDeviceGroupResource(sphereDeviceGroupResourceId); // invoke the operation - SphereDeviceGroupPatch patch = new SphereDeviceGroupPatch(); - ArmOperation lro = await sphereDeviceGroup.UpdateAsync(WaitUntil.Completed, patch); - SphereDeviceGroupResource result = lro.Value; + await sphereDeviceGroup.DeleteAsync(WaitUntil.Completed); - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - SphereDeviceGroupData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + Console.WriteLine($"Succeeded"); } // DeviceGroups_ClaimDevices diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceResource.cs index 1d8bdef0ee0ca..e9531da7fdac5 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereDeviceResource.cs @@ -52,13 +52,13 @@ public async Task Get_DevicesGet() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Devices_Delete + // Devices_Update [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DevicesDelete() + public async Task Update_DevicesUpdate() { - // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json - // this example is just showing the usage of "Devices_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json + // this example is just showing the usage of "Devices_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -70,25 +70,31 @@ public async Task Delete_DevicesDelete() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string productName = "MyProductName1"; - string deviceGroupName = "DeviceGroupName1"; + string productName = "MyProduct1"; + string deviceGroupName = "MyDeviceGroup1"; string deviceName = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; ResourceIdentifier sphereDeviceResourceId = SphereDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName); SphereDeviceResource sphereDevice = client.GetSphereDeviceResource(sphereDeviceResourceId); // invoke the operation - await sphereDevice.DeleteAsync(WaitUntil.Completed); + SphereDevicePatch patch = new SphereDevicePatch(); + ArmOperation lro = await sphereDevice.UpdateAsync(WaitUntil.Completed, patch); + SphereDeviceResource result = lro.Value; - Console.WriteLine($"Succeeded"); + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SphereDeviceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Devices_Update + // Devices_Delete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_DevicesUpdate() + public async Task Delete_DevicesDelete() { - // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json - // this example is just showing the usage of "Devices_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json + // this example is just showing the usage of "Devices_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -100,22 +106,16 @@ public async Task Update_DevicesUpdate() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string productName = "MyProduct1"; - string deviceGroupName = "MyDeviceGroup1"; + string productName = "MyProductName1"; + string deviceGroupName = "DeviceGroupName1"; string deviceName = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; ResourceIdentifier sphereDeviceResourceId = SphereDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName); SphereDeviceResource sphereDevice = client.GetSphereDeviceResource(sphereDeviceResourceId); // invoke the operation - SphereDevicePatch patch = new SphereDevicePatch(); - ArmOperation lro = await sphereDevice.UpdateAsync(WaitUntil.Completed, patch); - SphereDeviceResource result = lro.Value; + await sphereDevice.DeleteAsync(WaitUntil.Completed); - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - SphereDeviceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + Console.WriteLine($"Succeeded"); } // Devices_GenerateCapabilityImage diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageCollection.cs index d09cbe4b7feb4..e445b80535523 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageCollection.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageCollection.cs @@ -79,7 +79,7 @@ public async Task Get_ImagesGet() SphereImageCollection collection = sphereCatalog.GetSphereImages(); // invoke the operation - string imageName = "myImageId"; + string imageName = "00000000-0000-0000-0000-000000000000"; SphereImageResource result = await collection.GetAsync(imageName); // the variable result is a resource, you could call other operations on this instance as well @@ -114,7 +114,7 @@ public async Task Exists_ImagesGet() SphereImageCollection collection = sphereCatalog.GetSphereImages(); // invoke the operation - string imageName = "myImageId"; + string imageName = "00000000-0000-0000-0000-000000000000"; bool result = await collection.ExistsAsync(imageName); Console.WriteLine($"Succeeded: {result}"); @@ -145,7 +145,7 @@ public async Task GetIfExists_ImagesGet() SphereImageCollection collection = sphereCatalog.GetSphereImages(); // invoke the operation - string imageName = "myImageId"; + string imageName = "00000000-0000-0000-0000-000000000000"; NullableResponse response = await collection.GetIfExistsAsync(imageName); SphereImageResource result = response.HasValue ? response.Value : null; @@ -188,7 +188,7 @@ public async Task CreateOrUpdate_ImageCreateOrUpdate() SphereImageCollection collection = sphereCatalog.GetSphereImages(); // invoke the operation - string imageName = "default"; + string imageName = ".default"; SphereImageData data = new SphereImageData() { Image = "bXliYXNlNjRzdHJpbmc=", diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageResource.cs index 6fbe16665c0fc..0522f5923d095 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereImageResource.cs @@ -35,7 +35,7 @@ public async Task Get_ImagesGet() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string imageName = "myImageId"; + string imageName = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier sphereImageResourceId = SphereImageResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, imageName); SphereImageResource sphereImage = client.GetSphereImageResource(sphereImageResourceId); @@ -67,7 +67,7 @@ public async Task Update_ImageCreateOrUpdate() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string imageName = "default"; + string imageName = ".default"; ResourceIdentifier sphereImageResourceId = SphereImageResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, imageName); SphereImageResource sphereImage = client.GetSphereImageResource(sphereImageResourceId); @@ -104,7 +104,7 @@ public async Task Delete_ImagesDelete() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string imageName = "imageID"; + string imageName = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier sphereImageResourceId = SphereImageResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, imageName); SphereImageResource sphereImage = client.GetSphereImageResource(sphereImageResourceId); diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereProductResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereProductResource.cs index d3ed08af89a19..f008db9fa11d8 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereProductResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/samples/Generated/Samples/Sample_SphereProductResource.cs @@ -50,13 +50,13 @@ public async Task Get_ProductsGet() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Products_Delete + // Products_Update [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_ProductsDelete() + public async Task Update_ProductsUpdate() { - // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json - // this example is just showing the usage of "Products_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json + // this example is just showing the usage of "Products_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -68,23 +68,29 @@ public async Task Delete_ProductsDelete() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string productName = "MyProductName1"; + string productName = "MyProduct1"; ResourceIdentifier sphereProductResourceId = SphereProductResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, productName); SphereProductResource sphereProduct = client.GetSphereProductResource(sphereProductResourceId); // invoke the operation - await sphereProduct.DeleteAsync(WaitUntil.Completed); + SphereProductPatch patch = new SphereProductPatch(); + ArmOperation lro = await sphereProduct.UpdateAsync(WaitUntil.Completed, patch); + SphereProductResource result = lro.Value; - Console.WriteLine($"Succeeded"); + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SphereProductData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Products_Update + // Products_Delete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_ProductsUpdate() + public async Task Delete_ProductsDelete() { - // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json - // this example is just showing the usage of "Products_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json + // this example is just showing the usage of "Products_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -96,20 +102,14 @@ public async Task Update_ProductsUpdate() string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "MyResourceGroup1"; string catalogName = "MyCatalog1"; - string productName = "MyProduct1"; + string productName = "MyProductName1"; ResourceIdentifier sphereProductResourceId = SphereProductResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName, productName); SphereProductResource sphereProduct = client.GetSphereProductResource(sphereProductResourceId); // invoke the operation - SphereProductPatch patch = new SphereProductPatch(); - ArmOperation lro = await sphereProduct.UpdateAsync(WaitUntil.Completed, patch); - SphereProductResource result = lro.Value; + await sphereProduct.DeleteAsync(WaitUntil.Completed); - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - SphereProductData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + Console.WriteLine($"Succeeded"); } // Products_CountDevices diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CountDeviceResult.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CountDeviceResult.cs index bc7dd9287dd67..ee9ba7b5f45c3 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CountDeviceResult.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/CountDeviceResult.cs @@ -7,7 +7,7 @@ namespace Azure.ResourceManager.Sphere.Models { - /// Response to the action call for count devices in a catalog. + /// Response to the action call for count devices in a catalog (preview API). public partial class CountDeviceResult : CountElementsResult { /// Initializes a new instance of . diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/SphereProvisioningState.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/SphereProvisioningState.cs index 318d333d0496c..b7758aaa06d71 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/SphereProvisioningState.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Models/SphereProvisioningState.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Sphere.Models { - /// Provisioning state of the resource. + /// Provisioning state of resource. public readonly partial struct SphereProvisioningState : IEquatable { private readonly string _value; diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DeviceGroupsRestOperations.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DeviceGroupsRestOperations.cs index d308afb857d81..98dbabfa4dc4c 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DeviceGroupsRestOperations.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DeviceGroupsRestOperations.cs @@ -330,11 +330,11 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, SphereDeviceGroupPatch 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); @@ -350,75 +350,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); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. + /// Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. + /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, SphereDeviceGroupPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. + /// Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. + /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, SphereDeviceGroupPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, SphereDeviceGroupPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName) { 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); @@ -434,70 +440,64 @@ 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); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. + /// Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. - /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, SphereDeviceGroupPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. + /// Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. - /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, SphereDeviceGroupPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DevicesRestOperations.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DevicesRestOperations.cs index 71a588251f324..3a5e710c7a4db 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DevicesRestOperations.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/DevicesRestOperations.cs @@ -324,11 +324,11 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName, SphereDevicePatch 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); @@ -346,21 +346,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); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete a Device. + /// Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. /// Device name. + /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, string deviceName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName, SphereDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -368,31 +373,32 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete a Device. + /// Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. /// Device name. + /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, string deviceName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName, SphereDevicePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -400,25 +406,25 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName, SphereDevicePatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName) { 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); @@ -436,26 +442,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); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. + /// Delete a Device. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. /// Device name. - /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, string deviceName, SphereDevicePatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -463,32 +464,31 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. + /// Delete a Device. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. /// Name of device group. /// Device name. - /// The resource properties to be updated. /// 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 catalogName, string productName, string deviceGroupName, string deviceName, SphereDevicePatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string catalogName, string productName, string deviceGroupName, string deviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -496,14 +496,14 @@ public Response Update(string subscriptionId, string resourceGroupName, string c Argument.AssertNotNullOrEmpty(productName, nameof(productName)); Argument.AssertNotNullOrEmpty(deviceGroupName, nameof(deviceGroupName)); Argument.AssertNotNullOrEmpty(deviceName, nameof(deviceName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName, deviceGroupName, deviceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ImagesRestOperations.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ImagesRestOperations.cs index df0ee2860ba32..ced60fd458fb5 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ImagesRestOperations.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ImagesRestOperations.cs @@ -166,7 +166,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -199,7 +199,7 @@ public async Task> GetAsync(string subscriptionId, str /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -258,7 +258,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// Resource create parameters. /// The cancellation token to use. /// , , , or is null. @@ -287,7 +287,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// Resource create parameters. /// The cancellation token to use. /// , , , or is null. @@ -338,7 +338,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -366,7 +366,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ProductsRestOperations.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ProductsRestOperations.cs index c6cd153967b56..ce51c1cf56591 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ProductsRestOperations.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/RestOperations/ProductsRestOperations.cs @@ -288,11 +288,11 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, SphereProductPatch 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); @@ -306,71 +306,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); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + /// Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. + /// The resource properties to be updated. /// 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 catalogName, string productName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, string productName, SphereProductPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. + /// Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. + /// The resource properties to be updated. /// 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 catalogName, string productName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string catalogName, string productName, SphereProductPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName, SphereProductPatch patch) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName, string productName) { 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); @@ -384,66 +390,60 @@ 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); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. + /// Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. - /// The resource properties to be updated. /// 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 catalogName, string productName, SphereProductPatch patch, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string catalogName, string productName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. + /// Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of catalog. /// Name of product. - /// The resource properties to be updated. /// 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 catalogName, string productName, SphereProductPatch patch, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string catalogName, string productName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNullOrEmpty(productName, nameof(productName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, productName, patch); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName, productName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs index 31a0fe7f797e6..be7144e85b1bb 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs @@ -166,7 +166,7 @@ public virtual SphereImageCollection GetSphereImages() /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -189,7 +189,7 @@ public virtual async Task> GetSphereImageAsync(str /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereImageCollection.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereImageCollection.cs index d72c3e27a8cc1..8887731eb09c9 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereImageCollection.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereImageCollection.cs @@ -67,7 +67,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// Resource create parameters. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -108,7 +108,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// Resource create parameters. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -148,7 +148,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -185,7 +185,7 @@ public virtual async Task> GetAsync(string imageNa /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -274,7 +274,7 @@ public virtual Pageable GetAll(string filter = null, int? t /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -309,7 +309,7 @@ public virtual async Task> ExistsAsync(string imageName, Cancella /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -344,7 +344,7 @@ public virtual Response Exists(string imageName, CancellationToken cancell /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -381,7 +381,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// - /// Image name. Use .default for image creation. + /// Image name. Use an image GUID for GA versions of the API. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/autorest.md b/sdk/sphere/Azure.ResourceManager.Sphere/src/autorest.md index 92c4bd5818629..1fa9537faf399 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/autorest.md +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: Sphere namespace: Azure.ResourceManager.Sphere -require: https://github.com/Azure/azure-rest-api-specs/blob/a89f3906ba60257ae28a2eed756a1ee4ca72ed51/specification/sphere/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sphere/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: