diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md index a5c9cd9ed0302..83a6fbf46166d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.2.0 (2024-08-30) + +### Features Added + +- Release 1.2.0 + +### Breaking Changes + +### Bugs Fixed + ## 1.2.0-beta.4 (Unreleased) ### Features Added diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs new file mode 100644 index 0000000000000..b85a2edf37c27 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_EndpointResourcePropertiesBasicResource + { + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointResourcePropertiesBasicResource result = await endpointResourcePropertiesBasicResource.GetAsync(); + + // 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 + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/create.json + // this example is just showing the usage of "Endpoint_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointResourcePropertiesBasicResourceData data = new EndpointResourcePropertiesBasicResourceData(new OpenAIEndpointResourceProperties() + { + AssociatedResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.CognitiveService/account/account-1"), + Name = "Azure.OpenAI", + }); + ArmOperation lro = await endpointResourcePropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + EndpointResourcePropertiesBasicResource result = lro.Value; + + // 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 + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List Endpoint Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetKeys_ListEndpointKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/listKeys.json + // this example is just showing the usage of "Endpoint_ListKeys" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointKeys result = await endpointResourcePropertiesBasicResource.GetKeysAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint Models + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModels_GetEndpointModels() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/getModels.json + // this example is just showing the usage of "Endpoint_GetModels" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in endpointResourcePropertiesBasicResource.GetModelsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Regenerate Endpoint Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RegenerateKeys_RegenerateEndpointKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/regenerateKey.json + // this example is just showing the usage of "Endpoint_RegenerateKeys" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + RegenerateServiceAccountKeyContent content = new RegenerateServiceAccountKeyContent() + { + KeyName = ServiceAccountKeyName.Key1, + }; + AccountApiKeys result = await endpointResourcePropertiesBasicResource.RegenerateKeysAsync(content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..c87bb000906f4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_EndpointResourcePropertiesBasicResourceCollection + { + // List Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/list.json + // this example is just showing the usage of "Endpoint_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation and iterate over the result + EndpointType? endpointType = EndpointType.AzureOpenAI; + string skip = "skip_string"; + await foreach (EndpointResourcePropertiesBasicResource item in collection.GetAllAsync(endpointType: endpointType, skip: skip)) + { + // the variable item 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 + EndpointResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + EndpointResourcePropertiesBasicResource result = await collection.GetAsync(endpointName); + + // 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 + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + bool result = await collection.ExistsAsync(endpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + NullableResponse response = await collection.GetIfExistsAsync(endpointName); + EndpointResourcePropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/create.json + // this example is just showing the usage of "Endpoint_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + EndpointResourcePropertiesBasicResourceData data = new EndpointResourcePropertiesBasicResourceData(new OpenAIEndpointResourceProperties() + { + AssociatedResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.CognitiveService/account/account-1"), + Name = "Azure.OpenAI", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); + EndpointResourcePropertiesBasicResource result = lro.Value; + + // 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 + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs index 358b9768eef64..b037335159a1d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearninRegistryComponentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/list.json // this example is just showing the usage of "RegistryComponentContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryComponentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs index e313a64b2aa4b..31468d1db6a45 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearninRegistryComponentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/delete.json // this example is just showing the usage of "RegistryComponentContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json // this example is just showing the usage of "RegistryComponentContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryComponentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs index 805397cd3a9e5..a1abf8574e176 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearninRegistryComponentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/list.json // this example is just showing the usage of "RegistryComponentVersions_List" 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 @@ -61,7 +61,7 @@ public async Task GetAll_ListRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" 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 @@ -97,7 +97,7 @@ public async Task Get_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" 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 @@ -129,7 +129,7 @@ public async Task Exists_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" 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 @@ -173,7 +173,7 @@ public async Task GetIfExists_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryComponentVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs index 4f3ae02c632b0..13c4cf31e577e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearninRegistryComponentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/delete.json // this example is just showing the usage of "RegistryComponentVersions_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 @@ -50,7 +50,7 @@ public async Task Delete_DeleteRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json // this example is just showing the usage of "RegistryComponentVersions_Get" 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 @@ -83,7 +83,7 @@ public async Task Get_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryComponentVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs index 2ed214013cd40..a410a3bd78b90 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_MachineLearningBatchDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/list.json // this example is just showing the usage of "BatchDeployments_List" 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 @@ -63,7 +63,7 @@ public async Task GetAll_ListWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" 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 @@ -99,7 +99,7 @@ public async Task Get_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" 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 @@ -131,7 +131,7 @@ public async Task Exists_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" 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 @@ -175,7 +175,7 @@ public async Task GetIfExists_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json // this example is just showing the usage of "BatchDeployments_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs index 5d7c84a31476c..120915ad21fe4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningBatchDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/delete.json // this example is just showing the usage of "BatchDeployments_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json // this example is just showing the usage of "BatchDeployments_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceBatchDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchDeployment/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/update.json // this example is just showing the usage of "BatchDeployments_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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs index ad51d10f136f0..2a562c959df9e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningBatchEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/list.json // this example is just showing the usage of "BatchEndpoints_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" 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 @@ -94,7 +94,7 @@ public async Task Get_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" 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 @@ -125,7 +125,7 @@ public async Task Exists_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" 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 @@ -168,7 +168,7 @@ public async Task GetIfExists_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json // this example is just showing the usage of "BatchEndpoints_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs index fa2b890474d5e..426ea064a7c90 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningBatchEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/delete.json // this example is just showing the usage of "BatchEndpoints_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json // this example is just showing the usage of "BatchEndpoints_Get" 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 @@ -81,7 +81,7 @@ public async Task Get_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/update.json // this example is just showing the usage of "BatchEndpoints_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 @@ -130,7 +130,7 @@ public async Task Update_UpdateWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceBatchEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/BatchEndpoint/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/listKeys.json // this example is just showing the usage of "BatchEndpoints_ListKeys" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs index 85fd962527603..fbc05457edd07 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/list.json // this example is just showing the usage of "CodeContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json // this example is just showing the usage of "CodeContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs index ff117e0d7a303..e8f668094ce90 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/delete.json // this example is just showing the usage of "CodeContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json // this example is just showing the usage of "CodeContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json // this example is just showing the usage of "CodeContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs index 9ca9eb2efb7ed..58eca4e07e99d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/list.json // this example is just showing the usage of "CodeVersions_List" 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 @@ -60,7 +60,7 @@ public async Task GetAll_ListWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" 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 @@ -96,7 +96,7 @@ public async Task Get_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" 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 @@ -128,7 +128,7 @@ public async Task Exists_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" 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 @@ -172,7 +172,7 @@ public async Task GetIfExists_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json // this example is just showing the usage of "CodeVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs index b6dd152dd3706..9c6db8418b8de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningCodeVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/delete.json // this example is just showing the usage of "CodeVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json // this example is just showing the usage of "CodeVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json // this example is just showing the usage of "CodeVersions_CreateOrUpdate" 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 @@ -125,12 +125,47 @@ public async Task Update_CreateOrUpdateWorkspaceCodeVersion() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Publish Workspace Code Version. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceCodeVersion() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/publish.json + // this example is just showing the usage of "CodeVersions_Publish" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningCodeVersionResource created on azure + // for more information of creating MachineLearningCodeVersionResource, please refer to the document of MachineLearningCodeVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningCodeVersionResourceId = MachineLearningCodeVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningCodeVersionResource machineLearningCodeVersion = client.GetMachineLearningCodeVersionResource(machineLearningCodeVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningCodeVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } + // CreateOrGetStartPendingUpload Workspace Code Version. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadWorkspaceCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json // this example is just showing the usage of "CodeVersions_CreateOrGetStartPendingUpload" 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 @@ -152,7 +187,7 @@ public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadWor PendingUploadRequestDto body = new PendingUploadRequestDto() { PendingUploadId = "string", - PendingUploadType = PendingUploadType.TemporaryBlobReference, + PendingUploadType = PendingUploadType.None, }; PendingUploadResponseDto result = await machineLearningCodeVersion.CreateOrGetStartPendingUploadAsync(body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs index b1674dc96de40..1f34c30936247 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningComponentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/list.json // this example is just showing the usage of "ComponentContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "ComponentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs index 60097ab23f19a..d292981d4f427 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningComponentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/delete.json // this example is just showing the usage of "ComponentContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json // this example is just showing the usage of "ComponentContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceComponentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json // this example is just showing the usage of "ComponentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs index b9147859d58b9..0e269451ac340 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningComponentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/list.json // this example is just showing the usage of "ComponentVersions_List" 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 @@ -61,7 +61,7 @@ public async Task GetAll_ListWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" 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 @@ -97,7 +97,7 @@ public async Task Get_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" 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 @@ -129,7 +129,7 @@ public async Task Exists_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" 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 @@ -173,7 +173,7 @@ public async Task GetIfExists_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "ComponentVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs index 6768ffbba8889..957b44d9bcaeb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningComponentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/delete.json // this example is just showing the usage of "ComponentVersions_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 @@ -50,7 +50,7 @@ public async Task Delete_DeleteWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json // this example is just showing the usage of "ComponentVersions_Get" 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 @@ -83,7 +83,7 @@ public async Task Get_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceComponentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json // this example is just showing the usage of "ComponentVersions_CreateOrUpdate" 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 @@ -128,5 +128,40 @@ public async Task Update_CreateOrUpdateWorkspaceComponentVersion() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Publish Workspace Component Version. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceComponentVersion() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/publish.json + // this example is just showing the usage of "ComponentVersions_Publish" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComponentVersionResource created on azure + // for more information of creating MachineLearningComponentVersionResource, please refer to the document of MachineLearningComponentVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningComponentVersionResourceId = MachineLearningComponentVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningComponentVersionResource machineLearningComponentVersion = client.GetMachineLearningComponentVersionResource(machineLearningComponentVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningComponentVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs index ce39b03be9fa4..941b234767a73 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningComputeCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetComputes() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/list.json // this example is just showing the usage of "Compute_List" 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 @@ -58,7 +58,7 @@ public async Task GetAll_GetComputes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -93,7 +93,7 @@ public async Task Get_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -124,7 +124,7 @@ public async Task Exists_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -167,7 +167,7 @@ public async Task GetIfExists_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -202,7 +202,7 @@ public async Task Get_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -233,7 +233,7 @@ public async Task Exists_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -276,7 +276,7 @@ public async Task GetIfExists_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -311,7 +311,7 @@ public async Task Get_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -342,7 +342,7 @@ public async Task Exists_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -385,7 +385,7 @@ public async Task GetIfExists_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" 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 @@ -420,7 +420,7 @@ public async Task Get_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" 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 @@ -451,7 +451,7 @@ public async Task Exists_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" 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 @@ -494,7 +494,7 @@ public async Task GetIfExists_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_AttachAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -567,7 +567,7 @@ public async Task CreateOrUpdate_AttachAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -624,7 +624,7 @@ public async Task CreateOrUpdate_CreateAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADataFactoryCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -664,7 +664,7 @@ public async Task CreateOrUpdate_CreateADataFactoryCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -704,7 +704,7 @@ public async Task CreateOrUpdate_CreateAnAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -782,9 +782,22 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() Target = "/home/testuser/", } }, +Kernel = new JupyterKernelConfig() +{ +Argv = +{ +"option1","option2","option3" +}, +DisplayName = "TestKernel", +Language = "python", +}, } }, ComputeInstanceAuthorizationType = MachineLearningComputeInstanceAuthorizationType.Personal, + EnableOSPatching = true, + EnableRootAccess = true, + EnableSso = true, + ReleaseQuotaOnStop = true, PersonalComputeInstanceAssignedUser = new MachineLearningComputeInstanceAssignedUser("00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")), }, }, @@ -804,7 +817,7 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -857,7 +870,7 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithMinimalInputs() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -903,7 +916,7 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithMinimalInputs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/AmlCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 @@ -954,7 +967,7 @@ public async Task CreateOrUpdate_UpdateAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateAnAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/createOrUpdate/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/AKSCompute.json // this example is just showing the usage of "Compute_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs index 1b877c7c410bd..31e2e2a57a790 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningComputeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAKSCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AKSCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -54,7 +54,7 @@ public async Task Get_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAMLCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/AmlCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -86,7 +86,7 @@ public async Task Get_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAKubernetesCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/KubernetesCompute.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json // this example is just showing the usage of "Compute_Get" 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 @@ -118,7 +118,7 @@ public async Task Get_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/get/ComputeInstance.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json // this example is just showing the usage of "Compute_Get" 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 @@ -150,7 +150,7 @@ public async Task Get_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAAmlComputeCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/patch.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/patch.json // this example is just showing the usage of "Compute_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 @@ -191,7 +191,7 @@ public async Task Update_UpdateAAmlComputeCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/delete.json // this example is just showing the usage of "Compute_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 @@ -220,7 +220,7 @@ public async Task Delete_DeleteCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateCustomServices_UpdateCustomServices() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/updateCustomServices.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateCustomServices.json // this example is just showing the usage of "Compute_UpdateCustomServices" 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 @@ -293,7 +293,7 @@ public async Task UpdateCustomServices_UpdateCustomServices() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNodes_GetComputeNodesInformationForACompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/listNodes.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/listNodes.json // this example is just showing the usage of "Compute_ListNodes" 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 @@ -324,7 +324,7 @@ public async Task GetNodes_GetComputeNodesInformationForACompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListAKSComputeKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/listKeys.json // this example is just showing the usage of "Compute_ListKeys" 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 @@ -347,12 +347,52 @@ public async Task GetKeys_ListAKSComputeKeys() Console.WriteLine($"Succeeded: {result}"); } + // Update Data Mounts + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateDataMounts_UpdateDataMounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateDataMounts.json + // this example is just showing the usage of "Compute_UpdateDataMounts" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + IEnumerable dataMounts = new MachineLearningComputeInstanceDataMount[] + { +new MachineLearningComputeInstanceDataMount() +{ +Source = "azureml://subscriptions/some-sub/resourcegroups/some-rg/workspaces/some-ws/data/some-data-asset-name/versions/some-data-asset-version", +SourceType = MachineLearningSourceType.Uri, +MountName = "hello", +MountAction = MachineLearningMountAction.Mount, +MountMode = MountMode.ReadOnly, +MountPath = "/some/random/path/on/host", +} + }; + await machineLearningCompute.UpdateDataMountsAsync(dataMounts); + + Console.WriteLine($"Succeeded"); + } + // Start ComputeInstance Compute [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_StartComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/start.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/start.json // this example is just showing the usage of "Compute_Start" 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 @@ -380,7 +420,7 @@ public async Task Start_StartComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Stop_StopComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/stop.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/stop.json // this example is just showing the usage of "Compute_Stop" 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 @@ -408,7 +448,7 @@ public async Task Stop_StopComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_RestartComputeInstanceCompute() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/restart.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/restart.json // this example is just showing the usage of "Compute_Restart" 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 @@ -436,7 +476,7 @@ public async Task Restart_RestartComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateIdleShutdownSetting_UpdateIdleShutdownSettingOfComputeInstance() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Compute/updateIdleShutdownSetting.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateIdleShutdownSetting.json // this example is just showing the usage of "Compute_UpdateIdleShutdownSetting" 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 @@ -462,5 +502,68 @@ public async Task UpdateIdleShutdownSetting_UpdateIdleShutdownSettingOfComputeIn Console.WriteLine($"Succeeded"); } + + // List VM Sizes + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAllowedResizeSizes_ListVMSizes() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/getAllowedVMSizesForResize.json + // this example is just showing the usage of "Compute_GetAllowedResizeSizes" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation and iterate over the result + await foreach (MachineLearningVmSize item in machineLearningCompute.GetAllowedResizeSizesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List VM Sizes + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Resize_ListVMSizes() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/resize.json + // this example is just showing the usage of "Compute_Resize" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + ResizeSchema resizeSchema = new ResizeSchema() + { + TargetVmSize = "Standard_DS11_v2", + }; + await machineLearningCompute.ResizeAsync(WaitUntil.Completed, resizeSchema); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs index 44231630d0c08..3937c29f1adbf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/list.json // this example is just showing the usage of "DataContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/createOrUpdate.json // this example is just showing the usage of "DataContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs index 866afb33a81d8..492a2a6af754b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/delete.json // this example is just showing the usage of "DataContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json // this example is just showing the usage of "DataContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/createOrUpdate.json // this example is just showing the usage of "DataContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs index 279f665d7943a..c3539c21473c0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/list.json // this example is just showing the usage of "DataVersions_List" 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 @@ -41,8 +41,10 @@ public async Task GetAll_ListWorkspaceDataVersionBase() MachineLearningDataVersionCollection collection = machineLearningDataContainer.GetMachineLearningDataVersions(); // invoke the operation and iterate over the result - MachineLearningDataVersionCollectionGetAllOptions options = new MachineLearningDataVersionCollectionGetAllOptions() { OrderBy = "string", Top = 1, Tags = "string" }; - await foreach (MachineLearningDataVersionResource item in collection.GetAllAsync(options)) + string orderBy = "string"; + int? top = 1; + string tags = "string"; + await foreach (MachineLearningDataVersionResource item in collection.GetAllAsync(orderBy: orderBy, top: top, tags: tags)) { // the variable item 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 @@ -59,7 +61,7 @@ public async Task GetAll_ListWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" 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 @@ -95,7 +97,7 @@ public async Task Get_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" 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 @@ -127,7 +129,7 @@ public async Task Exists_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" 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 @@ -171,7 +173,7 @@ public async Task GetIfExists_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "DataVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs index 7d8a7d6ade0d3..b7d2f6e815957 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDataVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/delete.json // this example is just showing the usage of "DataVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json // this example is just showing the usage of "DataVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "DataVersions_CreateOrUpdate" 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 @@ -123,5 +123,40 @@ public async Task Update_CreateOrUpdateWorkspaceDataVersionBase() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Publish Workspace Data Version Base. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceDataVersionBase() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/publish.json + // this example is just showing the usage of "DataVersions_Publish" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningDataVersionResource created on azure + // for more information of creating MachineLearningDataVersionResource, please refer to the document of MachineLearningDataVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningDataVersionResourceId = MachineLearningDataVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningDataVersionResource machineLearningDataVersion = client.GetMachineLearningDataVersionResource(machineLearningDataVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningDataVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs index 03c06dfd3d4bd..7af753635dc01 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDatastoreCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" 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 @@ -55,7 +55,7 @@ public async Task Get_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" 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 @@ -86,7 +86,7 @@ public async Task Exists_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" 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 @@ -129,7 +129,7 @@ public async Task GetIfExists_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -184,7 +184,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen1WServic [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -241,7 +241,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen2WServic [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -294,7 +294,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureFileStoreWAccountKe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureBlobWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs index 13fdf9376fbd3..fdd397e1bbb22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningDatastoreResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/delete.json // this example is just showing the usage of "Datastores_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDatastore() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json // this example is just showing the usage of "Datastores_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -132,7 +132,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincip [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -186,7 +186,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincip [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -236,7 +236,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureBlobWAccountKey() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json // this example is just showing the usage of "Datastores_CreateOrUpdate" 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 @@ -288,7 +288,7 @@ public async Task Update_CreateOrUpdateDatastoreAzureBlobWAccountKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSecrets_GetDatastoreSecrets() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Datastore/listSecrets.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/listSecrets.json // this example is just showing the usage of "Datastores_ListSecrets" 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 @@ -306,7 +306,12 @@ public async Task GetSecrets_GetDatastoreSecrets() MachineLearningDatastoreResource machineLearningDatastore = client.GetMachineLearningDatastoreResource(machineLearningDatastoreResourceId); // invoke the operation - MachineLearningDatastoreSecrets result = await machineLearningDatastore.GetSecretsAsync(); + SecretExpiry body = new SecretExpiry() + { + ExpirableSecret = false, + ExpireAfterHours = 1, + }; + MachineLearningDatastoreSecrets result = await machineLearningDatastore.GetSecretsAsync(body: body); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs index 054896ffd3680..210023b977225 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/list.json // this example is just showing the usage of "EnvironmentContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "EnvironmentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs index b1a518198faaf..3b19437c84b96 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/delete.json // this example is just showing the usage of "EnvironmentContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json // this example is just showing the usage of "EnvironmentContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "EnvironmentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs index aa45f79c4bc35..240f5fc7f67fa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/list.json // this example is just showing the usage of "EnvironmentVersions_List" 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 @@ -60,7 +60,7 @@ public async Task GetAll_ListWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" 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 @@ -96,7 +96,7 @@ public async Task Get_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" 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 @@ -128,7 +128,7 @@ public async Task Exists_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" 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 @@ -172,7 +172,7 @@ public async Task GetIfExists_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "EnvironmentVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs index 3fbcb0eac6307..e27a0544fdb0a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningEnvironmentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/delete.json // this example is just showing the usage of "EnvironmentVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json // this example is just showing the usage of "EnvironmentVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "EnvironmentVersions_CreateOrUpdate" 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 @@ -135,5 +135,40 @@ public async Task Update_CreateOrUpdateWorkspaceEnvironmentVersion() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Publish Workspace Environment Version. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Publish_PublishWorkspaceEnvironmentVersion() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/publish.json + // this example is just showing the usage of "EnvironmentVersions_Publish" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningEnvironmentVersionResource created on azure + // for more information of creating MachineLearningEnvironmentVersionResource, please refer to the document of MachineLearningEnvironmentVersionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + string version = "string"; + ResourceIdentifier machineLearningEnvironmentVersionResourceId = MachineLearningEnvironmentVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); + MachineLearningEnvironmentVersionResource machineLearningEnvironmentVersion = client.GetMachineLearningEnvironmentVersionResource(machineLearningEnvironmentVersionResourceId); + + // invoke the operation + DestinationAsset body = new DestinationAsset() + { + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", + }; + await machineLearningEnvironmentVersion.PublishAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs index 71451ff7433c3..cb63f4b174632 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning.Samples { @@ -19,7 +20,7 @@ public partial class Sample_MachineLearningFeatureCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/list.json // this example is just showing the usage of "Features_List" 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 @@ -41,10 +42,8 @@ public async Task GetAll_ListFeature() MachineLearningFeatureCollection collection = machineLearningFeatureSetVersion.GetMachineLearningFeatures(); // invoke the operation and iterate over the result - string tags = "string"; - string featureName = "string"; - string description = "string"; - await foreach (MachineLearningFeatureResource item in collection.GetAllAsync(tags: tags, featureName: featureName, description: description)) + MachineLearningFeatureCollectionGetAllOptions options = new MachineLearningFeatureCollectionGetAllOptions() { Tags = "string", FeatureName = "string", Description = "string" }; + await foreach (MachineLearningFeatureResource item in collection.GetAllAsync(options)) { // the variable item 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 @@ -61,7 +60,7 @@ public async Task GetAll_ListFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" 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 @@ -98,7 +97,7 @@ public async Task Get_GetFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" 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 @@ -131,7 +130,7 @@ public async Task Exists_GetFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs index 31d43d88a4f59..345ad94183b7b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MachineLearningFeatureResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFeature() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Feature/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json // this example is just showing the usage of "Features_Get" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs index de134c2fed8c3..4910280ac2ab7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/list.json // this example is just showing the usage of "FeaturesetContainers_List" 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 @@ -58,7 +58,7 @@ public async Task GetAll_ListWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" 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 @@ -93,7 +93,7 @@ public async Task Get_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" 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 @@ -124,7 +124,7 @@ public async Task Exists_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" 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 @@ -167,7 +167,7 @@ public async Task GetIfExists_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json // this example is just showing the usage of "FeaturesetContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs index 90fa83d23d450..c98876f53bd37 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/delete.json // this example is just showing the usage of "FeaturesetContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json // this example is just showing the usage of "FeaturesetContainers_GetEntity" 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 @@ -80,7 +80,7 @@ public async Task Get_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturesetContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json // this example is just showing the usage of "FeaturesetContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs index 328edb827c948..017cf5f9f64f7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/list.json // this example is just showing the usage of "FeaturesetVersions_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" 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 @@ -95,7 +95,7 @@ public async Task Get_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" 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 @@ -127,7 +127,7 @@ public async Task Exists_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" 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 @@ -171,7 +171,7 @@ public async Task GetIfExists_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json // this example is just showing the usage of "FeaturesetVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs index 5ed2a6230139d..0322fbecb1c2d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureSetVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/delete.json // this example is just showing the usage of "FeaturesetVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json // this example is just showing the usage of "FeaturesetVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json // this example is just showing the usage of "FeaturesetVersions_CreateOrUpdate" 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 @@ -179,7 +179,7 @@ public async Task Update_CreateOrUpdateWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Backfill_BackfillWorkspaceFeaturesetVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/backfill.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/backfill.json // this example is just showing the usage of "FeaturesetVersions_Backfill" 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 @@ -200,6 +200,10 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() // invoke the operation FeatureSetVersionBackfillContent content = new FeatureSetVersionBackfillContent() { + DataAvailabilityStatus = +{ +DataAvailabilityStatus.None +}, Description = "string", DisplayName = "string", FeatureWindow = new FeatureWindow() @@ -207,6 +211,7 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() FeatureWindowEnd = DateTimeOffset.Parse("2020-01-01T12:34:56.999+00:51"), FeatureWindowStart = DateTimeOffset.Parse("2020-01-01T12:34:56.999+00:51"), }, + JobId = "string", ResourceInstanceType = "string", SparkConfiguration = { @@ -217,45 +222,10 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() ["string"] = "string", }, }; - ArmOperation lro = await machineLearningFeatureSetVersion.BackfillAsync(WaitUntil.Completed, content); - MachineLearningFeatureSetJob result = lro.Value; + ArmOperation lro = await machineLearningFeatureSetVersion.BackfillAsync(WaitUntil.Completed, content); + FeaturesetVersionBackfillResponse result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } - - // ListMaterializationJobs Workspace Featureset Version. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMaterializationJobs_ListMaterializationJobsWorkspaceFeaturesetVersion() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturesetVersion/listMaterializationJobs.json - // this example is just showing the usage of "FeaturesetVersions_ListMaterializationJobs" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningFeatureSetVersionResource created on azure - // for more information of creating MachineLearningFeatureSetVersionResource, please refer to the document of MachineLearningFeatureSetVersionResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "test-rg"; - string workspaceName = "my-aml-workspace"; - string name = "string"; - string version = "string"; - ResourceIdentifier machineLearningFeatureSetVersionResourceId = MachineLearningFeatureSetVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name, version); - MachineLearningFeatureSetVersionResource machineLearningFeatureSetVersion = client.GetMachineLearningFeatureSetVersionResource(machineLearningFeatureSetVersionResourceId); - - // invoke the operation and iterate over the result - string filters = "string"; - string featureWindowStart = "string"; - string featureWindowEnd = "string"; - await foreach (MachineLearningFeatureSetJob item in machineLearningFeatureSetVersion.GetMaterializationJobsAsync(filters: filters, featureWindowStart: featureWindowStart, featureWindowEnd: featureWindowEnd)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs index 5f0f4bcfabeea..5703389d9baf8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureStoreEntityContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json // this example is just showing the usage of "FeaturestoreEntityContainers_List" 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 @@ -58,7 +58,7 @@ public async Task GetAll_ListWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" 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 @@ -93,7 +93,7 @@ public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" 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 @@ -124,7 +124,7 @@ public async Task Exists_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" 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 @@ -167,7 +167,7 @@ public async Task GetIfExists_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs index 43d6f30770ef6..29a8f77229aaf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeatureStoreEntityContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json // this example is just showing the usage of "FeaturestoreEntityContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" 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 @@ -80,7 +80,7 @@ public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturestoreEntityContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs index 474c9532cdc9e..0c243903be494 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeaturestoreEntityVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json // this example is just showing the usage of "FeaturestoreEntityVersions_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" 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 @@ -95,7 +95,7 @@ public async Task Get_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" 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 @@ -127,7 +127,7 @@ public async Task Exists_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" 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 @@ -171,7 +171,7 @@ public async Task GetIfExists_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs index deb9ac3799a0c..9adb6dc0282e5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningFeaturestoreEntityVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json // this example is just showing the usage of "FeaturestoreEntityVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json // this example is just showing the usage of "FeaturestoreEntityVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturestoreEntityVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json // this example is just showing the usage of "FeaturestoreEntityVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs index 73e6c7d1de477..6552673667bc1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningJobCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/list.json // this example is just showing the usage of "Jobs_List" 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 @@ -42,8 +42,7 @@ public async Task GetAll_ListAutoMLJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string", ListViewType = MachineLearningListViewType.All, AssetName = "string", Scheduled = false, ScheduleId = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + await foreach (MachineLearningJobResource item in collection.GetAllAsync()) { // the variable item 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 @@ -60,7 +59,7 @@ public async Task GetAll_ListAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/list.json // this example is just showing the usage of "Jobs_List" 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 @@ -80,8 +79,49 @@ public async Task GetAll_ListCommandJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string", ListViewType = MachineLearningListViewType.ActiveOnly, AssetName = "string", Scheduled = false, ScheduleId = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + string jobType = "string"; + string tag = "string"; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) + { + // the variable item 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 + MachineLearningJobData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/list.json + // this example is just showing the usage of "Jobs_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation and iterate over the result + string jobType = "string"; + string tag = "string"; + MachineLearningListViewType? listViewType = MachineLearningListViewType.All; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag, listViewType: listViewType)) { // the variable item 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 @@ -98,7 +138,7 @@ public async Task GetAll_ListCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/list.json // this example is just showing the usage of "Jobs_List" 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 @@ -118,8 +158,9 @@ public async Task GetAll_ListPipelineJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + string jobType = "string"; + string tag = "string"; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) { // the variable item 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 @@ -136,7 +177,7 @@ public async Task GetAll_ListPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/list.json // this example is just showing the usage of "Jobs_List" 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 @@ -156,8 +197,9 @@ public async Task GetAll_ListSweepJob() MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); // invoke the operation and iterate over the result - MachineLearningJobCollectionGetAllOptions options = new MachineLearningJobCollectionGetAllOptions() { JobType = "string", Tag = "string", ListViewType = MachineLearningListViewType.ActiveOnly, AssetName = "string", Scheduled = false, ScheduleId = "string" }; - await foreach (MachineLearningJobResource item in collection.GetAllAsync(options)) + string jobType = "string"; + string tag = "string"; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) { // the variable item 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 @@ -174,7 +216,7 @@ public async Task GetAll_ListSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -209,7 +251,7 @@ public async Task Get_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -240,7 +282,7 @@ public async Task Exists_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -283,7 +325,7 @@ public async Task GetIfExists_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -318,7 +360,7 @@ public async Task Get_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -349,7 +391,116 @@ public async Task Exists_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json + // this example is just showing the usage of "Jobs_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + NullableResponse response = await collection.GetIfExistsAsync(id); + MachineLearningJobResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json + // this example is just showing the usage of "Jobs_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + MachineLearningJobResource result = await collection.GetAsync(id); + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json + // this example is just showing the usage of "Jobs_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + bool result = await collection.ExistsAsync(id); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -392,7 +543,7 @@ public async Task GetIfExists_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -427,7 +578,7 @@ public async Task Get_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -458,7 +609,7 @@ public async Task Exists_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -501,7 +652,7 @@ public async Task GetIfExists_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -536,7 +687,7 @@ public async Task Get_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -567,7 +718,7 @@ public async Task Exists_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -610,7 +761,7 @@ public async Task GetIfExists_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" 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 @@ -631,87 +782,61 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() // invoke the operation string id = "string"; - MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) + MachineLearningJobData data = new MachineLearningJobData(new AutoMLJob(new ImageClassification(new MachineLearningTableJobInput(new Uri("string")), new ImageLimitSettings() { - MlflowAutologger = MachineLearningFlowAutoLoggerState.Disabled, - CodeId = new ResourceIdentifier("string"), - Distribution = new TensorFlowDistributionConfiguration() + MaxTrials = 2, + }) + { + ModelSettings = new ImageModelSettingsClassification() { - ParameterServerCount = 1, - WorkerCount = 1, + ValidationCropSize = 2, }, - EnvironmentVariables = + SearchSpace = { -["string"] = "string", -}, - Inputs = -{ -["string"] = new MachineLearningLiteralJobInput("string") +new ImageModelDistributionSettingsClassification() { -Description = "string", +ValidationCropSize = "choice(2, 360)", +} }, + TargetColumnName = "string", + }) + { + EnvironmentId = "string", + EnvironmentVariables = +{ +["string"] = "string", }, - Limits = new MachineLearningCommandJobLimits() - { - Timeout = XmlConvert.ToTimeSpan("PT5M"), - }, Outputs = { ["string"] = new MachineLearningUriFileJobOutput() { -AssetName = "string", -AssetVersion = "string", -Mode = MachineLearningOutputDeliveryMode.Direct, +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, Uri = new Uri("string"), Description = "string", }, }, - QueueSettings = new JobQueueSettings() - { - JobTier = JobTier.Premium, - Priority = 1, - }, Resources = new MachineLearningJobResourceConfiguration() { - DockerArgs = "string", - ShmSize = "2g", InstanceCount = 1, InstanceType = "string", - Locations = -{ -"string" -}, Properties = { ["string"] = BinaryData.FromObjectAsJson(new Dictionary() { -["f69c8d5a-9b39-4183-92d3-a2b18944cf95"] = null}), +["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), }, }, - ComponentId = new ResourceIdentifier("string"), ComputeId = new ResourceIdentifier("string"), DisplayName = "string", ExperimentName = "string", Identity = new AmlToken(), IsArchived = false, - NotificationSetting = new NotificationSetting() - { - EmailOn = -{ -EmailNotificationEnableType.JobCompleted -}, - Emails = -{ -"string" -}, - }, Services = { ["string"] = new MachineLearningJobService() { Endpoint = "string", JobServiceType = "string", -Nodes = new JobAllNodes(), Port = 1, Properties = { @@ -744,7 +869,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" 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 @@ -767,7 +892,6 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() string id = "string"; MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) { - MlflowAutologger = MachineLearningFlowAutoLoggerState.Disabled, CodeId = new ResourceIdentifier("string"), Distribution = new TensorFlowDistributionConfiguration() { @@ -793,59 +917,32 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() { ["string"] = new MachineLearningUriFileJobOutput() { -AssetName = "string", -AssetVersion = "string", -Mode = MachineLearningOutputDeliveryMode.Upload, +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, Uri = new Uri("string"), Description = "string", }, }, - QueueSettings = new JobQueueSettings() - { - JobTier = JobTier.Basic, - Priority = 1, - }, Resources = new MachineLearningJobResourceConfiguration() { - DockerArgs = "string", - ShmSize = "2g", InstanceCount = 1, InstanceType = "string", - Locations = -{ -"string" -}, Properties = { ["string"] = BinaryData.FromObjectAsJson(new Dictionary() { -["c9ac10d0-915b-4de5-afe8-a4c78a37a558"] = null}), +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), }, }, - ComponentId = new ResourceIdentifier("string"), ComputeId = new ResourceIdentifier("string"), DisplayName = "string", ExperimentName = "string", Identity = new AmlToken(), - IsArchived = false, - NotificationSetting = new NotificationSetting() - { - EmailOn = -{ -EmailNotificationEnableType.JobCancelled -}, - Emails = -{ -"string" -}, - }, Services = { ["string"] = new MachineLearningJobService() { Endpoint = "string", JobServiceType = "string", -Nodes = new JobAllNodes(), Port = 1, Properties = { @@ -873,12 +970,68 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // CreateOrUpdate FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + MachineLearningJobData data = new MachineLearningJobData(new FineTuningJob(new CustomModelFineTuning(FineTuningTaskType.TextCompletion, new MachineLearningUriFileJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }, new MachineLearningFlowModelJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }), new Dictionary() + { + ["string"] = new MachineLearningFlowModelJobOutput() + { + Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, + Uri = new Uri("string"), + Description = "string", + }, + }) + { + ExperimentName = "llm-finetuning", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, id, data); + MachineLearningJobResource result = lro.Value; + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // CreateOrUpdate Pipeline Job. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdatePipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" 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 @@ -961,7 +1114,7 @@ public async Task CreateOrUpdate_CreateOrUpdatePipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/createOrUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" 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 @@ -982,87 +1135,55 @@ public async Task CreateOrUpdate_CreateOrUpdateSweepJob() // invoke the operation string id = "string"; - MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(new MachineLearningObjective(MachineLearningGoal.Minimize, "string"), new GridSamplingAlgorithm(), BinaryData.FromObjectAsJson(new Dictionary() + { + ["string"] = new Dictionary() + { + } + }), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) { - MlflowAutologger = MachineLearningFlowAutoLoggerState.Disabled, CodeId = new ResourceIdentifier("string"), - Distribution = new TensorFlowDistributionConfiguration() + Distribution = new MpiDistributionConfiguration() { - ParameterServerCount = 1, - WorkerCount = 1, + ProcessCountPerInstance = 1, }, EnvironmentVariables = { ["string"] = "string", }, - Inputs = -{ -["string"] = new MachineLearningLiteralJobInput("string") -{ -Description = "string", -}, -}, - Limits = new MachineLearningCommandJobLimits() - { - Timeout = XmlConvert.ToTimeSpan("PT5M"), - }, - Outputs = -{ -["string"] = new MachineLearningUriFileJobOutput() -{ -AssetName = "string", -AssetVersion = "string", -Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, -Uri = new Uri("string"), -Description = "string", -}, -}, - QueueSettings = new JobQueueSettings() - { - JobTier = JobTier.Basic, - Priority = 1, - }, Resources = new MachineLearningJobResourceConfiguration() { - DockerArgs = "string", - ShmSize = "2g", InstanceCount = 1, InstanceType = "string", - Locations = -{ -"string" -}, Properties = { ["string"] = BinaryData.FromObjectAsJson(new Dictionary() { -["5fc1f627-491e-45a0-a6a2-f5b4be884911"] = null}), +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), }, }, - ComponentId = new ResourceIdentifier("string"), + }) + { + EarlyTermination = new MedianStoppingPolicy() + { + DelayEvaluation = 1, + EvaluationInterval = 1, + }, + Limits = new MachineLearningSweepJobLimits() + { + MaxConcurrentTrials = 1, + MaxTotalTrials = 1, + TrialTimeout = XmlConvert.ToTimeSpan("PT1S"), + }, ComputeId = new ResourceIdentifier("string"), DisplayName = "string", ExperimentName = "string", - Identity = new AmlToken(), - IsArchived = false, - NotificationSetting = new NotificationSetting() - { - EmailOn = -{ -EmailNotificationEnableType.JobCompleted -}, - Emails = -{ -"string" -}, - }, Services = { ["string"] = new MachineLearningJobService() { Endpoint = "string", JobServiceType = "string", -Nodes = new JobAllNodes(), Port = 1, Properties = { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs index 4e7991dd89b8f..4c1dd15df8746 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs @@ -6,7 +6,9 @@ #nullable disable using System; +using System.Collections.Generic; using System.Threading.Tasks; +using System.Xml; using Azure.Core; using Azure.Identity; using Azure.ResourceManager.MachineLearning.Models; @@ -20,7 +22,7 @@ public partial class Sample_MachineLearningJobResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/delete.json // this example is just showing the usage of "Jobs_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 @@ -33,7 +35,7 @@ public async Task Delete_DeleteJob() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "my-aml-workspace"; - string id = "string"; + string id = "http://subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/my-favorite-aml-job"; ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); @@ -48,7 +50,7 @@ public async Task Delete_DeleteJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAutoMLJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/AutoMLJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -80,7 +82,39 @@ public async Task Get_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCommandJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/CommandJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json + // this example is just showing the usage of "Jobs_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobResource result = await machineLearningJob.GetAsync(); + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -112,7 +146,7 @@ public async Task Get_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetPipelineJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/PipelineJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -144,7 +178,7 @@ public async Task Get_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/SweepJob/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json // this example is just showing the usage of "Jobs_Get" 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 @@ -171,13 +205,354 @@ public async Task Get_GetSweepJob() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Update Job. + // CreateOrUpdate AutoML Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateAutoMLJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new AutoMLJob(new ImageClassification(new MachineLearningTableJobInput(new Uri("string")), new ImageLimitSettings() + { + MaxTrials = 2, + }) + { + ModelSettings = new ImageModelSettingsClassification() + { + ValidationCropSize = 2, + }, + SearchSpace = +{ +new ImageModelDistributionSettingsClassification() +{ +ValidationCropSize = "choice(2, 360)", +} +}, + TargetColumnName = "string", + }) + { + EnvironmentId = "string", + EnvironmentVariables = +{ +["string"] = "string", +}, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), +}, + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), + IsArchived = false, + Services = +{ +["string"] = new MachineLearningJobService() +{ +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = +{ +["string"] = "string", +}, +}, +}, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Command Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateCommandJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) + { + CodeId = new ResourceIdentifier("string"), + Distribution = new TensorFlowDistributionConfiguration() + { + ParameterServerCount = 1, + WorkerCount = 1, + }, + EnvironmentVariables = +{ +["string"] = "string", +}, + Inputs = +{ +["string"] = new MachineLearningLiteralJobInput("string") +{ +Description = "string", +}, +}, + Limits = new MachineLearningCommandJobLimits() + { + Timeout = XmlConvert.ToTimeSpan("PT5M"), + }, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), +}, + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), + Services = +{ +["string"] = new MachineLearningJobService() +{ +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = +{ +["string"] = "string", +}, +}, +}, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new FineTuningJob(new CustomModelFineTuning(FineTuningTaskType.TextCompletion, new MachineLearningUriFileJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }, new MachineLearningFlowModelJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }), new Dictionary() + { + ["string"] = new MachineLearningFlowModelJobOutput() + { + Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, + Uri = new Uri("string"), + Description = "string", + }, + }) + { + ExperimentName = "llm-finetuning", + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Pipeline Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdatePipelineJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningPipelineJob() + { + Inputs = +{ +["string"] = new MachineLearningLiteralJobInput("string") +{ +Description = "string", +}, +}, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.Upload, +Uri = new Uri("string"), +Description = "string", +}, +}, + Settings = BinaryData.FromObjectAsJson(new Dictionary() + { + }), + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Services = +{ +["string"] = new MachineLearningJobService() +{ +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = +{ +["string"] = "string", +}, +}, +}, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // 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 + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Sweep Job. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateJob() + public async Task Update_CreateOrUpdateSweepJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/update.json - // this example is just showing the usage of "Jobs_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" 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(); @@ -194,17 +569,74 @@ public async Task Update_UpdateJob() MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); // invoke the operation - MachineLearningJobPatch patch = new MachineLearningJobPatch() + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(new MachineLearningObjective(MachineLearningGoal.Minimize, "string"), new GridSamplingAlgorithm(), BinaryData.FromObjectAsJson(new Dictionary() + { + ["string"] = new Dictionary() + { + } + }), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) + { + CodeId = new ResourceIdentifier("string"), + Distribution = new MpiDistributionConfiguration() + { + ProcessCountPerInstance = 1, + }, + EnvironmentVariables = +{ +["string"] = "string", +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), +}, + }, + }) { - NotificationSettingWebhooks = + EarlyTermination = new MedianStoppingPolicy() + { + DelayEvaluation = 1, + EvaluationInterval = 1, + }, + Limits = new MachineLearningSweepJobLimits() + { + MaxConcurrentTrials = 1, + MaxTotalTrials = 1, + TrialTimeout = XmlConvert.ToTimeSpan("PT1S"), + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Services = +{ +["string"] = new MachineLearningJobService() { -["string"] = new AzureDevOpsWebhook() +Endpoint = "string", +JobServiceType = "string", +Port = 1, +Properties = { -EventType = "string", +["string"] = "string", +}, +}, }, + Description = "string", + Properties = +{ +["string"] = "string", +}, + Tags = +{ +["string"] = "string", }, - }; - MachineLearningJobResource result = await machineLearningJob.UpdateAsync(patch); + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; // 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 @@ -218,7 +650,7 @@ public async Task Update_UpdateJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Cancel_CancelJob() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Job/cancel.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/cancel.json // this example is just showing the usage of "Jobs_Cancel" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs deleted file mode 100644 index 28fcb669725e5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobResource.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning.Samples -{ - public partial class Sample_MachineLearningLabelingJobResource - { - // Delete Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/delete.json - // this example is just showing the usage of "LabelingJobs_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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - await machineLearningLabelingJob.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Get Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - MachineLearningLabelingJobResource result = await machineLearningLabelingJob.GetAsync(includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); - - // 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 - MachineLearningLabelingJobData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CreateOrUpdate Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateOrUpdateLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/createOrUpdate.json - // this example is just showing the usage of "LabelingJobs_CreateOrUpdate" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - MachineLearningLabelingJobData data = new MachineLearningLabelingJobData(new LabelingJobProperties() - { - JobInstructionsUri = new Uri("link/to/instructions"), - LabelCategories = -{ -["myCategory1"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory1Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -["myCategory2"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory2Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -}, - LabelingJobMediaProperties = new LabelingJobImageProperties(), - MlAssistConfiguration = new MachineLearningAssistEnabledConfiguration("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/myscoringcompute", "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/mytrainingompute"), - Description = "string", - Properties = -{ -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", -}, - Tags = -{ -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", -}, - }); - ArmOperation lro = await machineLearningLabelingJob.UpdateAsync(WaitUntil.Completed, data); - MachineLearningLabelingJobResource result = lro.Value; - - // 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 - MachineLearningLabelingJobData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ExportLabels Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task ExportLabels_ExportLabelsLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/exportLabels.json - // this example is just showing the usage of "LabelingJobs_ExportLabels" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - ExportSummary body = new DatasetExportSummary(); - ArmOperation lro = await machineLearningLabelingJob.ExportLabelsAsync(WaitUntil.Completed, body); - ExportSummary result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // Pause Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Pause_PauseLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/pause.json - // this example is just showing the usage of "LabelingJobs_Pause" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - await machineLearningLabelingJob.PauseAsync(); - - Console.WriteLine($"Succeeded"); - } - - // Resume Labeling Job. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Resume_ResumeLabelingJob() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/resume.json - // this example is just showing the usage of "LabelingJobs_Resume" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningLabelingJobResource created on azure - // for more information of creating MachineLearningLabelingJobResource, please refer to the document of MachineLearningLabelingJobResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; - string id = "testLabelingJob"; - ResourceIdentifier machineLearningLabelingJobResourceId = MachineLearningLabelingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); - MachineLearningLabelingJobResource machineLearningLabelingJob = client.GetMachineLearningLabelingJobResource(machineLearningLabelingJobResourceId); - - // invoke the operation - await machineLearningLabelingJob.ResumeAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs index 6da1cbff6ef8f..5211c70c4aafb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/list.json // this example is just showing the usage of "ModelContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json // this example is just showing the usage of "ModelContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs index 2a483ce425a40..e1a7547a3caca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/delete.json // this example is just showing the usage of "ModelContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json // this example is just showing the usage of "ModelContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json // this example is just showing the usage of "ModelContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs index b7c9685636eed..0ca1db3a38611 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/list.json // this example is just showing the usage of "ModelVersions_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" 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 @@ -95,7 +95,7 @@ public async Task Get_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" 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 @@ -127,7 +127,7 @@ public async Task Exists_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" 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 @@ -171,7 +171,7 @@ public async Task GetIfExists_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json // this example is just showing the usage of "ModelVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs index 49f745854eb38..9211e26060e1c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningModelVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/delete.json // this example is just showing the usage of "ModelVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json // this example is just showing the usage of "ModelVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json // this example is just showing the usage of "ModelVersions_CreateOrUpdate" 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 @@ -136,13 +136,13 @@ public async Task Update_CreateOrUpdateWorkspaceModelVersion() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Package Workspace Model Version. + // Publish Workspace Model Version. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Package_PackageWorkspaceModelVersion() + public async Task Publish_PublishWorkspaceModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/ModelVersion/package.json - // this example is just showing the usage of "ModelVersions_Package" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/publish.json + // this example is just showing the usage of "ModelVersions_Publish" 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(); @@ -160,44 +160,15 @@ public async Task Package_PackageWorkspaceModelVersion() MachineLearningModelVersionResource machineLearningModelVersion = client.GetMachineLearningModelVersionResource(machineLearningModelVersionResourceId); // invoke the operation - ModelPackageContent content = new ModelPackageContent(new AzureMLBatchInferencingServer() + DestinationAsset body = new DestinationAsset() { - CodeConfiguration = new MachineLearningCodeConfiguration("string") - { - CodeId = new ResourceIdentifier("string"), - }, - }, "string") - { - BaseEnvironmentSource = new BaseEnvironmentType(new ResourceIdentifier("string")), - EnvironmentVariables = -{ -["string"] = "string", -}, - Inputs = -{ -new ModelPackageInput(PackageInputType.UriFile,new PackageInputPathUri() -{ -Uri = new Uri("string"), -}) -{ -Mode = PackageInputDeliveryMode.Download, -MountPath = "string", -} -}, - ModelConfiguration = new ModelConfiguration() - { - Mode = new PackageInputDeliveryMode("ReadOnlyMount"), - MountPath = "string", - }, - Tags = -{ -["string"] = "string", -}, + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", }; - ArmOperation lro = await machineLearningModelVersion.PackageAsync(WaitUntil.Completed, content); - ModelPackageResult result = lro.Value; + await machineLearningModelVersion.PublishAsync(WaitUntil.Completed, body); - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine($"Succeeded"); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs index 88af0ad0df629..b70d5c39543ca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningOnlineDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListOnlineDeployments() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/list.json // this example is just showing the usage of "OnlineDeployments_List" 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 @@ -62,7 +62,7 @@ public async Task GetAll_ListOnlineDeployments() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -98,7 +98,7 @@ public async Task Get_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -130,7 +130,7 @@ public async Task Exists_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -174,7 +174,7 @@ public async Task GetIfExists_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -210,7 +210,7 @@ public async Task Get_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -242,7 +242,7 @@ public async Task Exists_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -286,7 +286,7 @@ public async Task GetIfExists_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json // this example is just showing the usage of "OnlineDeployments_CreateOrUpdate" 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 @@ -394,7 +394,7 @@ public async Task CreateOrUpdate_CreateOrUpdateKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json // this example is just showing the usage of "OnlineDeployments_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs index f7e6269331dfb..23dd7bfff8559 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningOnlineDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineDeployment/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineDeployment/delete.json // this example is just showing the usage of "OnlineDeployments_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json // this example is just showing the usage of "OnlineDeployments_Get" 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 @@ -115,7 +115,7 @@ public async Task Get_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateKubernetesOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json // this example is just showing the usage of "OnlineDeployments_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 @@ -163,7 +163,7 @@ public async Task Update_UpdateKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedOnlineDeployment() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json // this example is just showing the usage of "OnlineDeployments_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 @@ -211,7 +211,7 @@ public async Task Update_UpdateManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetLogs_GetOnlineDeploymentLogs() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/getLogs.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/getLogs.json // this example is just showing the usage of "OnlineDeployments_GetLogs" 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 @@ -245,7 +245,7 @@ public async Task GetLogs_GetOnlineDeploymentLogs() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_ListKubernetesOnlineDeploymentSkus() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json // this example is just showing the usage of "OnlineDeployments_ListSkus" 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 @@ -278,7 +278,7 @@ public async Task GetSkus_ListKubernetesOnlineDeploymentSkus() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_ListManagedOnlineDeploymentSkus() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json // this example is just showing the usage of "OnlineDeployments_ListSkus" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs index 41c03690cce17..7a891d4721a73 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningOnlineEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/list.json // this example is just showing the usage of "OnlineEndpoints_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" 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 @@ -94,7 +94,7 @@ public async Task Get_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" 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 @@ -125,7 +125,7 @@ public async Task Exists_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" 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 @@ -168,7 +168,7 @@ public async Task GetIfExists_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json // this example is just showing the usage of "OnlineEndpoints_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs index 55d647bfb4f1a..715ec18d2608d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningOnlineEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/delete.json // this example is just showing the usage of "OnlineEndpoints_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json // this example is just showing the usage of "OnlineEndpoints_Get" 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 @@ -81,7 +81,7 @@ public async Task Get_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/update.json // this example is just showing the usage of "OnlineEndpoints_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 @@ -130,7 +130,7 @@ public async Task Update_UpdateWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json // this example is just showing the usage of "OnlineEndpoints_ListKeys" 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 @@ -158,7 +158,7 @@ public async Task GetKeys_ListKeysWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKeys_RegenerateKeysWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json // this example is just showing the usage of "OnlineEndpoints_RegenerateKeys" 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 @@ -190,7 +190,7 @@ public async Task RegenerateKeys_RegenerateKeysWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetToken_GetTokenWorkspaceOnlineEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/OnlineEndpoint/getToken.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/getToken.json // this example is just showing the usage of "OnlineEndpoints_GetToken" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs index cd22304e5fbf9..6d8dfac3695ba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningOutboundRuleBasicCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/listRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/listRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" 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 @@ -77,7 +77,7 @@ public async Task Get_GetManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; MachineLearningOutboundRuleBasicResource result = await collection.GetAsync(ruleName); // the variable result is a resource, you could call other operations on this instance as well @@ -92,7 +92,7 @@ public async Task Get_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" 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 @@ -112,7 +112,7 @@ public async Task Exists_GetManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; bool result = await collection.ExistsAsync(ruleName); Console.WriteLine($"Succeeded: {result}"); @@ -123,7 +123,7 @@ public async Task Exists_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" 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 @@ -143,7 +143,7 @@ public async Task GetIfExists_GetManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; NullableResponse response = await collection.GetIfExistsAsync(ruleName); MachineLearningOutboundRuleBasicResource result = response.HasValue ? response.Value : null; @@ -166,7 +166,7 @@ public async Task GetIfExists_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/createOrUpdateRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/createOrUpdateRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_CreateOrUpdate" 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 @@ -186,10 +186,10 @@ public async Task CreateOrUpdate_CreateOrUpdateManagedNetworkSettingsRule() MachineLearningOutboundRuleBasicCollection collection = machineLearningWorkspace.GetMachineLearningOutboundRuleBasics(); // invoke the operation - string ruleName = "some_string"; + string ruleName = "rule_name_1"; MachineLearningOutboundRuleBasicData data = new MachineLearningOutboundRuleBasicData(new FqdnOutboundRule() { - Destination = "some_string", + Destination = "destination_endpoint", Category = OutboundRuleCategory.UserDefined, Status = OutboundRuleStatus.Active, }); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs index bbca1b772066e..1f110f29783e9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningOutboundRuleBasicResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/deleteRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/deleteRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_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 @@ -33,7 +33,7 @@ public async Task Delete_DeleteManagedNetworkSettingsRule() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "aml-workspace-name"; - string ruleName = "some_string"; + string ruleName = "rule-name"; ResourceIdentifier machineLearningOutboundRuleBasicResourceId = MachineLearningOutboundRuleBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, ruleName); MachineLearningOutboundRuleBasicResource machineLearningOutboundRuleBasic = client.GetMachineLearningOutboundRuleBasicResource(machineLearningOutboundRuleBasicResourceId); @@ -48,7 +48,7 @@ public async Task Delete_DeleteManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/getRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" 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 @@ -61,7 +61,7 @@ public async Task Get_GetManagedNetworkSettingsRule() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "aml-workspace-name"; - string ruleName = "some_string"; + string ruleName = "name_of_the_fqdn_rule"; ResourceIdentifier machineLearningOutboundRuleBasicResourceId = MachineLearningOutboundRuleBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, ruleName); MachineLearningOutboundRuleBasicResource machineLearningOutboundRuleBasic = client.GetMachineLearningOutboundRuleBasicResource(machineLearningOutboundRuleBasicResourceId); @@ -80,7 +80,7 @@ public async Task Get_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateManagedNetworkSettingsRule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/createOrUpdateRule.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/createOrUpdateRule.json // this example is just showing the usage of "ManagedNetworkSettingsRule_CreateOrUpdate" 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 @@ -93,14 +93,14 @@ public async Task Update_CreateOrUpdateManagedNetworkSettingsRule() string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; string workspaceName = "aml-workspace-name"; - string ruleName = "some_string"; + string ruleName = "rule_name_1"; ResourceIdentifier machineLearningOutboundRuleBasicResourceId = MachineLearningOutboundRuleBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, ruleName); MachineLearningOutboundRuleBasicResource machineLearningOutboundRuleBasic = client.GetMachineLearningOutboundRuleBasicResource(machineLearningOutboundRuleBasicResourceId); // invoke the operation MachineLearningOutboundRuleBasicData data = new MachineLearningOutboundRuleBasicData(new FqdnOutboundRule() { - Destination = "some_string", + Destination = "destination_endpoint", Category = OutboundRuleCategory.UserDefined, Status = OutboundRuleStatus.Active, }); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs index 38c1a533a69af..11ec149a08014 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_StorageAccountListPrivateEndpointConnections() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/list.json // this example is just showing the usage of "PrivateEndpointConnections_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_StorageAccountListPrivateEndpointConnections() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_WorkspacePutPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs index 77866f8276800..947195048b750 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_WorkspacePutPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/delete.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -48,7 +48,7 @@ public async Task Delete_WorkspacePutPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGetPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_WorkspacePutPrivateEndpointConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs index dd4bfcdca63d1..eb071ebcb0084 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/list.json // this example is just showing the usage of "RegistryCodeContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/createOrUpdate.json // this example is just showing the usage of "RegistryCodeContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs index 7246a78a7c2da..1c255d1b17587 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/delete.json // this example is just showing the usage of "RegistryCodeContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json // this example is just showing the usage of "RegistryCodeContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryCodeContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/createOrUpdate.json // this example is just showing the usage of "RegistryCodeContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs index f9f11d1d4d2f8..0c00637f99ed9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/list.json // this example is just showing the usage of "RegistryCodeVersions_List" 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 @@ -60,7 +60,7 @@ public async Task GetAll_ListRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" 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 @@ -96,7 +96,7 @@ public async Task Get_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" 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 @@ -128,7 +128,7 @@ public async Task Exists_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" 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 @@ -172,7 +172,7 @@ public async Task GetIfExists_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrUpdate.json // this example is just showing the usage of "RegistryCodeVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs index 34797a31321fa..478f35ea7b9a2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryCodeVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/delete.json // this example is just showing the usage of "RegistryCodeVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json // this example is just showing the usage of "RegistryCodeVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrUpdate.json // this example is just showing the usage of "RegistryCodeVersions_CreateOrUpdate" 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 @@ -130,7 +130,7 @@ public async Task Update_CreateOrUpdateRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryCodeVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json // this example is just showing the usage of "RegistryCodeVersions_CreateOrGetStartPendingUpload" 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 @@ -152,7 +152,7 @@ public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadReg PendingUploadRequestDto body = new PendingUploadRequestDto() { PendingUploadId = "string", - PendingUploadType = PendingUploadType.None, + PendingUploadType = PendingUploadType.TemporaryBlobReference, }; PendingUploadResponseDto result = await machineLearningRegistryCodeVersion.CreateOrGetStartPendingUploadAsync(body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs index 4fdb6d2fc1089..601f95a319cd5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs @@ -22,7 +22,43 @@ public partial class Sample_MachineLearningRegistryCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistriesWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/list-SystemCreated.json + // this example is just showing the usage of "Registries_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation and iterate over the result + await foreach (MachineLearningRegistryResource item in collection.GetAllAsync()) + { + // the variable item 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 + MachineLearningRegistryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List registries with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRegistriesWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/list-UserCreated.json // this example is just showing the usage of "Registries_List" 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 @@ -58,7 +94,7 @@ public async Task GetAll_ListRegistriesWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json // this example is just showing the usage of "Registries_Get" 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 @@ -92,7 +128,7 @@ public async Task Get_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json // this example is just showing the usage of "Registries_Get" 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 @@ -122,7 +158,113 @@ public async Task Exists_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json + // this example is just showing the usage of "Registries_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + NullableResponse response = await collection.GetIfExistsAsync(registryName); + MachineLearningRegistryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json + // this example is just showing the usage of "Registries_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + MachineLearningRegistryResource result = await collection.GetAsync(registryName); + + // 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 + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json + // this example is just showing the usage of "Registries_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + bool result = await collection.ExistsAsync(registryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json // this example is just showing the usage of "Registries_Get" 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 @@ -164,7 +306,7 @@ public async Task GetIfExists_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/createOrUpdate-SystemCreated.json // this example is just showing the usage of "Registries_CreateOrUpdate" 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 @@ -205,7 +347,7 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts IntellectualPropertyPublisher = "string", ManagedResourceId = new ResourceIdentifier("string"), MlFlowRegistryUri = new Uri("string"), - PrivateEndpointConnections = + RegistryPrivateEndpointConnections = { new RegistryPrivateEndpointConnection() { @@ -219,7 +361,7 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts { SubnetArmId = new ResourceIdentifier("string"), }, -PrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() +RegistryPrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() { ActionsRequired = "string", Description = "string", @@ -275,5 +417,110 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // CreateOrUpdate Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/createOrUpdate-UserCreated.json + // this example is just showing the usage of "Registries_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningRegistryResource + MachineLearningRegistryCollection collection = resourceGroupResource.GetMachineLearningRegistries(); + + // invoke the operation + string registryName = "string"; + MachineLearningRegistryData data = new MachineLearningRegistryData(new AzureLocation("string")) + { + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), +}, + }, + Kind = "string", + Sku = new MachineLearningSku("string") + { + Tier = MachineLearningSkuTier.Free, + Size = "string", + Family = "string", + Capacity = 1, + }, + DiscoveryUri = new Uri("string"), + IntellectualPropertyPublisher = "string", + ManagedResourceId = new ResourceIdentifier("string"), + MlFlowRegistryUri = new Uri("string"), + RegistryPrivateEndpointConnections = +{ +new RegistryPrivateEndpointConnection() +{ +Id = new ResourceIdentifier("string"), +Location = new AzureLocation("string"), +GroupIds = +{ +"string" +}, +PrivateEndpoint = new RegistryPrivateEndpoint() +{ +SubnetArmId = new ResourceIdentifier("string"), +}, +RegistryPrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() +{ +ActionsRequired = "string", +Description = "string", +Status = MachineLearningPrivateEndpointServiceConnectionStatus.Approved, +}, +ProvisioningState = "string", +} +}, + PublicNetworkAccess = "string", + RegionDetails = +{ +new RegistryRegionArmDetails() +{ +AcrDetails = +{ +new RegistryAcrDetails() +{ +ArmResourceId = new ResourceIdentifier("string"), +} +}, +Location = new AzureLocation("string"), +StorageAccountDetails = +{ +new StorageAccountDetails() +{ +ArmResourceId = new ResourceIdentifier("string"), +} +}, +} +}, + Tags = +{ +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, registryName, data); + MachineLearningRegistryResource result = lro.Value; + + // 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 + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs index b38c427953980..d03eaa57501a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_RegistryListRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/registryList.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/registryList.json // this example is just showing the usage of "RegistryDataContainers_List" 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 @@ -58,7 +58,7 @@ public async Task GetAll_RegistryListRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" 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 @@ -93,7 +93,7 @@ public async Task Get_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" 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 @@ -124,7 +124,7 @@ public async Task Exists_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" 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 @@ -167,7 +167,7 @@ public async Task GetIfExists_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/createOrUpdate.json // this example is just showing the usage of "RegistryDataContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs index e64bf4a43a24d..4643b39bdd4e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/delete.json // this example is just showing the usage of "RegistryDataContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json // this example is just showing the usage of "RegistryDataContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryDataContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/createOrUpdate.json // this example is just showing the usage of "RegistryDataContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs index 82e6de696a3ab..504edabb1f9dd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_RegistryListRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/registryList.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/registryList.json // this example is just showing the usage of "RegistryDataVersions_List" 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 @@ -62,7 +62,7 @@ public async Task GetAll_RegistryListRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" 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 @@ -98,7 +98,7 @@ public async Task Get_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" 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 @@ -130,7 +130,7 @@ public async Task Exists_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" 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 @@ -174,7 +174,7 @@ public async Task GetIfExists_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "RegistryDataVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs index e5625a757c868..585198b8eb920 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryDataVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/delete.json // this example is just showing the usage of "RegistryDataVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json // this example is just showing the usage of "RegistryDataVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json // this example is just showing the usage of "RegistryDataVersions_CreateOrUpdate" 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 @@ -134,7 +134,7 @@ public async Task Update_CreateOrUpdateRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryDataVersionBase() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json // this example is just showing the usage of "RegistryDataVersions_CreateOrGetStartPendingUpload" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs index 508f9da305e18..d2c18ad5a5aa3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentContainerCollectio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/list.json // this example is just showing the usage of "RegistryEnvironmentContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs index 28ca562afb065..909c579c52ab2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/delete.json // this example is just showing the usage of "RegistryEnvironmentContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json // this example is just showing the usage of "RegistryEnvironmentContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryEnvironmentContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs index 88a56c863cfb2..1a4accc406495 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/list.json // this example is just showing the usage of "RegistryEnvironmentVersions_List" 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 @@ -60,7 +60,7 @@ public async Task GetAll_ListRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" 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 @@ -96,7 +96,7 @@ public async Task Get_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" 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 @@ -128,7 +128,7 @@ public async Task Exists_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" 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 @@ -172,7 +172,7 @@ public async Task GetIfExists_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs index 55a4ffe1f4cc5..4391cd0a14908 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryEnvironmentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/delete.json // this example is just showing the usage of "RegistryEnvironmentVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json // this example is just showing the usage of "RegistryEnvironmentVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryEnvironmentVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json // this example is just showing the usage of "RegistryEnvironmentVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs index 156a6c6bffc8d..20bab15e0910c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/list.json // this example is just showing the usage of "RegistryModelContainers_List" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" 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 @@ -123,7 +123,7 @@ public async Task Exists_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" 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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/createOrUpdate.json // this example is just showing the usage of "RegistryModelContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs index 950f3e0f2e219..a0dc575e7a281 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/delete.json // this example is just showing the usage of "RegistryModelContainers_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 @@ -48,7 +48,7 @@ public async Task Delete_DeleteRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json // this example is just showing the usage of "RegistryModelContainers_Get" 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 @@ -80,7 +80,7 @@ public async Task Get_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryModelContainer() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelContainer/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/createOrUpdate.json // this example is just showing the usage of "RegistryModelContainers_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs index a7fe18e774915..92f94d6ac3e38 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/list.json // this example is just showing the usage of "RegistryModelVersions_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" 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 @@ -95,7 +95,7 @@ public async Task Get_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" 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 @@ -127,7 +127,7 @@ public async Task Exists_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" 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 @@ -171,7 +171,7 @@ public async Task GetIfExists_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrUpdate.json // this example is just showing the usage of "RegistryModelVersions_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs index 280c1c263f3f0..84d7db0765f99 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningRegistryModelVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/delete.json // this example is just showing the usage of "RegistryModelVersions_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json // this example is just showing the usage of "RegistryModelVersions_Get" 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 @@ -82,7 +82,7 @@ public async Task Get_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrUpdate.json // this example is just showing the usage of "RegistryModelVersions_CreateOrUpdate" 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 @@ -136,76 +136,12 @@ public async Task Update_CreateOrUpdateRegistryModelVersion() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Package Registry Model Version. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Package_PackageRegistryModelVersion() - { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/package.json - // this example is just showing the usage of "RegistryModelVersions_Package" 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(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineLearningRegistryModelVersionResource created on azure - // for more information of creating MachineLearningRegistryModelVersionResource, please refer to the document of MachineLearningRegistryModelVersionResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "test-rg"; - string registryName = "my-aml-registry"; - string modelName = "string"; - string version = "string"; - ResourceIdentifier machineLearningRegistryModelVersionResourceId = MachineLearningRegistryModelVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, modelName, version); - MachineLearningRegistryModelVersionResource machineLearningRegistryModelVersion = client.GetMachineLearningRegistryModelVersionResource(machineLearningRegistryModelVersionResourceId); - - // invoke the operation - ModelPackageContent content = new ModelPackageContent(new AzureMLBatchInferencingServer() - { - CodeConfiguration = new MachineLearningCodeConfiguration("string") - { - CodeId = new ResourceIdentifier("string"), - }, - }, "string") - { - BaseEnvironmentSource = new BaseEnvironmentType(new ResourceIdentifier("string")), - EnvironmentVariables = -{ -["string"] = "string", -}, - Inputs = -{ -new ModelPackageInput(PackageInputType.UriFile,new PackageInputPathUri() -{ -Uri = new Uri("string"), -}) -{ -Mode = PackageInputDeliveryMode.Download, -MountPath = "string", -} -}, - ModelConfiguration = new ModelConfiguration() - { - Mode = new PackageInputDeliveryMode("ReadOnlyMount"), - MountPath = "string", - }, - Tags = -{ -["string"] = "string", -}, - }; - ArmOperation lro = await machineLearningRegistryModelVersion.PackageAsync(WaitUntil.Completed, content); - ModelPackageResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CreateOrGetStartPendingUpload Registry Model Version. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryModelVersion() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json // this example is just showing the usage of "RegistryModelVersions_CreateOrGetStartPendingUpload" 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 @@ -227,7 +163,7 @@ public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadReg PendingUploadRequestDto body = new PendingUploadRequestDto() { PendingUploadId = "string", - PendingUploadType = PendingUploadType.None, + PendingUploadType = PendingUploadType.TemporaryBlobReference, }; PendingUploadResponseDto result = await machineLearningRegistryModelVersion.CreateOrGetStartPendingUploadAsync(body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs index d8cac5eb21c59..3602d65f8a45d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs @@ -17,12 +17,46 @@ namespace Azure.ResourceManager.MachineLearning.Samples { public partial class Sample_MachineLearningRegistryResource { + // GetBlobReferenceSAS Data Reference. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetBlobReferenceSasRegistryDataReference_GetBlobReferenceSASDataReference() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/DataReference/getBlobReferenceSAS.json + // this example is just showing the usage of "RegistryDataReferences_GetBlobReferenceSas" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "registryName"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + string name = "string"; + string version = "string"; + GetBlobReferenceSasRequestDto body = new GetBlobReferenceSasRequestDto() + { + AssetId = "string", + BlobUri = new Uri("https://www.contoso.com/example"), + }; + GetBlobReferenceSasResponseDto result = await machineLearningRegistry.GetBlobReferenceSasRegistryDataReferenceAsync(name, version, body); + + Console.WriteLine($"Succeeded: {result}"); + } + // List registries by subscription. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningRegistries_ListRegistriesBySubscription() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/listBySubscription.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/listBySubscription.json // this example is just showing the usage of "Registries_ListBySubscription" 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 @@ -54,7 +88,7 @@ public async Task GetMachineLearningRegistries_ListRegistriesBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistry() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/delete.json // this example is just showing the usage of "Registries_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 @@ -81,7 +115,38 @@ public async Task Delete_DeleteRegistry() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json + // this example is just showing the usage of "Registries_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "string"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + MachineLearningRegistryResource result = await machineLearningRegistry.GetAsync(); + + // 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 + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json // this example is just showing the usage of "Registries_Get" 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 @@ -112,7 +177,7 @@ public async Task Get_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateRegistryWithSystemCreatedAccounts() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/update-SystemCreated.json // this example is just showing the usage of "Registries_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 @@ -159,12 +224,64 @@ public async Task Update_UpdateRegistryWithSystemCreatedAccounts() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Update Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/update-UserCreated.json + // this example is just showing the usage of "Registries_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "string"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + MachineLearningRegistryPatch patch = new MachineLearningRegistryPatch() + { + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), +}, + }, + Sku = new MachineLearningSkuPatch() + { + Capacity = 1, + Family = "string", + Name = "string", + Size = "string", + Tier = MachineLearningSkuTier.Basic, + }, + Tags = +{ +}, + }; + MachineLearningRegistryResource result = await machineLearningRegistry.UpdateAsync(patch); + + // 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 + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Remove regions from registry [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RemoveRegions_RemoveRegionsFromRegistry() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Registries/removeRegions.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/removeRegions.json // this example is just showing the usage of "Registries_RemoveRegions" 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 @@ -202,7 +319,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() IntellectualPropertyPublisher = "string", ManagedResourceId = new ResourceIdentifier("string"), MlFlowRegistryUri = new Uri("string"), - PrivateEndpointConnections = + RegistryPrivateEndpointConnections = { new RegistryPrivateEndpointConnection() { @@ -216,7 +333,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() { SubnetArmId = new ResourceIdentifier("string"), }, -PrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() +RegistryPrivateLinkServiceConnectionState = new RegistryPrivateLinkServiceConnectionState() { ActionsRequired = "string", Description = "string", @@ -240,6 +357,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() AcrAccountSku = "string", ArmResourceId = new ResourceIdentifier("string"), }, +ArmResourceId = new ResourceIdentifier("string"), } }, Location = new AzureLocation("string"), @@ -255,6 +373,7 @@ public async Task RemoveRegions_RemoveRegionsFromRegistry() StorageAccountName = "string", StorageAccountType = "string", }, +ArmResourceId = new ResourceIdentifier("string"), } }, } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs index 7cd0a3aa6321c..049dcbc1b0915 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningScheduleCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListSchedules() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/list.json // this example is just showing the usage of "Schedules_List" 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 @@ -58,7 +58,7 @@ public async Task GetAll_ListSchedules() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" 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 @@ -93,7 +93,7 @@ public async Task Get_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" 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 @@ -124,7 +124,7 @@ public async Task Exists_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" 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 @@ -167,7 +167,7 @@ public async Task GetIfExists_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/createOrUpdate.json // this example is just showing the usage of "Schedules_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs index bfde2eb0c612a..08b92858b18f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningScheduleResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/delete.json // this example is just showing the usage of "Schedules_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 @@ -49,7 +49,7 @@ public async Task Delete_DeleteSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json // this example is just showing the usage of "Schedules_Get" 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 @@ -81,7 +81,7 @@ public async Task Get_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateSchedule() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Schedule/createOrUpdate.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/createOrUpdate.json // this example is just showing the usage of "Schedules_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs index 838412ab6c489..961aa1eddc87f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_MachineLearningWorkspaceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetWorkspacesByResourceGroup() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listByResourceGroup.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listByResourceGroup.json // this example is just showing the usage of "Workspaces_ListByResourceGroup" 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 @@ -58,7 +58,7 @@ public async Task GetAll_GetWorkspacesByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" 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 @@ -92,7 +92,7 @@ public async Task Get_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" 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 @@ -122,7 +122,7 @@ public async Task Exists_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" 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 @@ -164,7 +164,7 @@ public async Task GetIfExists_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/create.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/create.json // this example is just showing the usage of "Workspaces_CreateOrUpdate" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs index 1523c92386bd7..56970054f07e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineLearningWorkspaceConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceConnections() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/list.json // this example is just showing the usage of "WorkspaceConnections_List" 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 @@ -59,7 +59,7 @@ public async Task GetAll_ListWorkspaceConnections() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" 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 @@ -94,7 +94,7 @@ public async Task Get_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" 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 @@ -125,7 +125,7 @@ public async Task Exists_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" 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 @@ -168,7 +168,7 @@ public async Task GetIfExists_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/create.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/create.json // this example is just showing the usage of "WorkspaceConnections_Create" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs index 4d00d1e1e1941..23da7862194c1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; @@ -21,7 +20,7 @@ public partial class Sample_MachineLearningWorkspaceConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/delete.json // this example is just showing the usage of "WorkspaceConnections_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 @@ -49,7 +48,7 @@ public async Task Delete_DeleteWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json // this example is just showing the usage of "WorkspaceConnections_Get" 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 @@ -81,7 +80,7 @@ public async Task Get_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/update.json // this example is just showing the usage of "WorkspaceConnections_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 @@ -93,8 +92,8 @@ public async Task Update_UpdateWorkspaceConnection() // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; - string workspaceName = "aml-workspace-name"; - string connectionName = "some_string"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); @@ -110,9 +109,9 @@ public async Task Update_UpdateWorkspaceConnection() }, Category = MachineLearningConnectionCategory.AdlsGen2, ExpiryOn = DateTimeOffset.Parse("2020-01-01T00:00:00Z"), - Metadata = BinaryData.FromObjectAsJson(new Dictionary() - { - }), + Metadata = +{ +}, Target = "some_string", }, }; @@ -130,7 +129,7 @@ public async Task Update_UpdateWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSecrets_GetWorkspaceConnection() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceConnection/listSecrets.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listSecrets.json // this example is just showing the usage of "WorkspaceConnections_ListSecrets" 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 @@ -142,8 +141,8 @@ public async Task GetSecrets_GetWorkspaceConnection() // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "test-rg"; - string workspaceName = "aml-workspace-name"; - string connectionName = "some_string"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); @@ -156,5 +155,70 @@ public async Task GetSecrets_GetWorkspaceConnection() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // TestWorkspaceConnection + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task TestConnection_TestWorkspaceConnection() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/testConnection.json + // this example is just showing the usage of "WorkspaceConnections_TestConnection" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // invoke the operation + MachineLearningWorkspaceConnectionData data = new MachineLearningWorkspaceConnectionData(new MachineLearningNoneAuthTypeWorkspaceConnection() + { + Category = MachineLearningConnectionCategory.ContainerRegistry, + ExpiryOn = DateTimeOffset.Parse("2024-03-15T14:30:00Z"), + Target = "target_url", + }); + await machineLearningWorkspaceConnection.TestConnectionAsync(WaitUntil.Completed, data: data); + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Models + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModelsConnections_GetAzureOpenAIConnectionModels() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getModels.json + // this example is just showing the usage of "Connection_GetModels" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in machineLearningWorkspaceConnection.GetModelsConnectionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs index 82dde3fb93635..f6ec98c17e7f0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MachineLearningWorkspaceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetWorkspaceFeatures_ListWorkspaceFeatures() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/WorkspaceFeature/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceFeature/list.json // this example is just showing the usage of "WorkspaceFeatures_List" 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 @@ -51,7 +51,7 @@ public async Task GetWorkspaceFeatures_ListWorkspaceFeatures() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningWorkspaces_GetWorkspacesBySubscription() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listBySubscription.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listBySubscription.json // this example is just showing the usage of "Workspaces_ListBySubscription" 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 @@ -83,7 +83,7 @@ public async Task GetMachineLearningWorkspaces_GetWorkspacesBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/delete.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/delete.json // this example is just showing the usage of "Workspaces_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 @@ -110,7 +110,7 @@ public async Task Delete_DeleteWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json // this example is just showing the usage of "Workspaces_Get" 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 @@ -141,7 +141,7 @@ public async Task Get_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/update.json // this example is just showing the usage of "Workspaces_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 @@ -179,7 +179,7 @@ public async Task Update_UpdateWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Diagnose_DiagnoseWorkspace() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/diagnose.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/diagnose.json // this example is just showing the usage of "Workspaces_Diagnose" 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 @@ -240,7 +240,7 @@ public async Task Diagnose_DiagnoseWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listKeys.json // this example is just showing the usage of "Workspaces_ListKeys" 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 @@ -267,7 +267,7 @@ public async Task GetKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNotebookAccessToken_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listNotebookAccessToken.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listNotebookAccessToken.json // this example is just showing the usage of "Workspaces_ListNotebookAccessToken" 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 @@ -294,7 +294,7 @@ public async Task GetNotebookAccessToken_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNotebookKeys_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Notebook/listKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Notebook/listKeys.json // this example is just showing the usage of "Workspaces_ListNotebookKeys" 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 @@ -321,7 +321,7 @@ public async Task GetNotebookKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStorageAccountKeys_ListWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/listStorageAccountKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listStorageAccountKeys.json // this example is just showing the usage of "Workspaces_ListStorageAccountKeys" 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 @@ -348,7 +348,7 @@ public async Task GetStorageAccountKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpoints() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ExternalFQDN/get.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ExternalFQDN/get.json // this example is just showing the usage of "Workspaces_ListOutboundNetworkDependenciesEndpoints" 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 @@ -378,7 +378,7 @@ public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDep [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PrepareNotebook_PrepareNotebook() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Notebook/prepare.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Notebook/prepare.json // this example is just showing the usage of "Workspaces_PrepareNotebook" 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 @@ -406,7 +406,7 @@ public async Task PrepareNotebook_PrepareNotebook() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ResyncKeys_ResyncWorkspaceKeys() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Workspace/resyncKeys.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/resyncKeys.json // this example is just showing the usage of "Workspaces_ResyncKeys" 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 @@ -428,12 +428,76 @@ public async Task ResyncKeys_ResyncWorkspaceKeys() Console.WriteLine($"Succeeded"); } + // Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModelsConnections_GetModelsUnderTheAzureMLWorkspaceForAllAzureOpenAIConnectionsThatTheUserCanDeploy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listConnectionModels.json + // this example is just showing the usage of "Connection_ListModels" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in machineLearningWorkspace.GetModelsConnectionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployments In Workspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetInWorkspaceEndpointDeployments_GetEndpointDeploymentsInWorkspace() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/getInWorkspace.json + // this example is just showing the usage of "EndpointDeployment_GetInWorkspace" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointDeploymentResource item in machineLearningWorkspace.GetInWorkspaceEndpointDeploymentsAsync()) + { + // the variable item 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + // WorkspaceListPrivateLinkResources [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_WorkspaceListPrivateLinkResources() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/PrivateLinkResource/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateLinkResource/list.json // this example is just showing the usage of "PrivateLinkResources_List" 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 @@ -463,7 +527,7 @@ public async Task GetPrivateLinkResources_WorkspaceListPrivateLinkResources() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ProvisionManagedNetworkManagedNetworkProvision_ProvisionManagedNetwork() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/ManagedNetwork/provision.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/provision.json // this example is just showing the usage of "ManagedNetworkProvisions_ProvisionManagedNetwork" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs new file mode 100644 index 0000000000000..617b53afb3d53 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_MarketplaceSubscriptionCollection + { + // List Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/list.json + // this example is just showing the usage of "MarketplaceSubscriptions_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation and iterate over the result + await foreach (MarketplaceSubscriptionResource item in collection.GetAllAsync()) + { + // the variable item 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 + MarketplaceSubscriptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + MarketplaceSubscriptionResource result = await collection.GetAsync(name); + + // 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 + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + NullableResponse response = await collection.GetIfExistsAsync(name); + MarketplaceSubscriptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // CreateOrUpdate Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json + // this example is just showing the usage of "MarketplaceSubscriptions_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MarketplaceSubscriptionResource + MarketplaceSubscriptionCollection collection = machineLearningWorkspace.GetMarketplaceSubscriptions(); + + // invoke the operation + string name = "string"; + MarketplaceSubscriptionData data = new MarketplaceSubscriptionData(new MarketplaceSubscriptionProperties("string")); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + MarketplaceSubscriptionResource result = lro.Value; + + // 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 + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs new file mode 100644 index 0000000000000..1ffbcee59581f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_MarketplaceSubscriptionResource + { + // Delete Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/delete.json + // this example is just showing the usage of "MarketplaceSubscriptions_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MarketplaceSubscriptionResource created on azure + // for more information of creating MarketplaceSubscriptionResource, please refer to the document of MarketplaceSubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier marketplaceSubscriptionResourceId = MarketplaceSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + MarketplaceSubscriptionResource marketplaceSubscription = client.GetMarketplaceSubscriptionResource(marketplaceSubscriptionResourceId); + + // invoke the operation + await marketplaceSubscription.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json + // this example is just showing the usage of "MarketplaceSubscriptions_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MarketplaceSubscriptionResource created on azure + // for more information of creating MarketplaceSubscriptionResource, please refer to the document of MarketplaceSubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier marketplaceSubscriptionResourceId = MarketplaceSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + MarketplaceSubscriptionResource marketplaceSubscription = client.GetMarketplaceSubscriptionResource(marketplaceSubscriptionResourceId); + + // invoke the operation + MarketplaceSubscriptionResource result = await marketplaceSubscription.GetAsync(); + + // 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 + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate Workspace Marketplace Subscription. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateWorkspaceMarketplaceSubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json + // this example is just showing the usage of "MarketplaceSubscriptions_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MarketplaceSubscriptionResource created on azure + // for more information of creating MarketplaceSubscriptionResource, please refer to the document of MarketplaceSubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier marketplaceSubscriptionResourceId = MarketplaceSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + MarketplaceSubscriptionResource marketplaceSubscription = client.GetMarketplaceSubscriptionResource(marketplaceSubscriptionResourceId); + + // invoke the operation + MarketplaceSubscriptionData data = new MarketplaceSubscriptionData(new MarketplaceSubscriptionProperties("string")); + ArmOperation lro = await marketplaceSubscription.UpdateAsync(WaitUntil.Completed, data); + MarketplaceSubscriptionResource result = lro.Value; + + // 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 + MarketplaceSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs new file mode 100644 index 0000000000000..6ef2b6e228f28 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistItemPropertiesBasicResource + { + // Delete RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/delete.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + await raiBlocklistItemPropertiesBasicResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistItemPropertiesBasicResource result = await raiBlocklistItemPropertiesBasicResource.GetAsync(); + + // 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 + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/create.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistItemPropertiesBasicResourceData data = new RaiBlocklistItemPropertiesBasicResourceData(new RaiBlocklistItemProperties() + { + IsRegex = false, + Pattern = "Pattern To Block", + }); + ArmOperation lro = await raiBlocklistItemPropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + RaiBlocklistItemPropertiesBasicResource result = lro.Value; + + // 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 + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..09ebde51ea62f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistItemPropertiesBasicResourceCollection + { + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + RaiBlocklistItemPropertiesBasicResource result = await collection.GetAsync(raiBlocklistItemName); + + // 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 + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + bool result = await collection.ExistsAsync(raiBlocklistItemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + NullableResponse response = await collection.GetIfExistsAsync(raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/create.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + RaiBlocklistItemPropertiesBasicResourceData data = new RaiBlocklistItemPropertiesBasicResourceData(new RaiBlocklistItemProperties() + { + IsRegex = false, + Pattern = "Pattern To Block", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiBlocklistItemName, data); + RaiBlocklistItemPropertiesBasicResource result = lro.Value; + + // 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 + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List RaiBlocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/list.json + // this example is just showing the usage of "ConnectionRaiBlocklistItems_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation and iterate over the result + await foreach (RaiBlocklistItemPropertiesBasicResource item in collection.GetAllAsync()) + { + // the variable item 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 + RaiBlocklistItemPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs new file mode 100644 index 0000000000000..aacc0ca4270fd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistPropertiesBasicResource + { + // Delete Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/delete.json + // this example is just showing the usage of "ConnectionRaiBlocklist_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + await raiBlocklistPropertiesBasicResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistPropertiesBasicResource result = await raiBlocklistPropertiesBasicResource.GetAsync(); + + // 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 + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/create.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistPropertiesBasicResourceData data = new RaiBlocklistPropertiesBasicResourceData(new RaiBlocklistProperties() + { + Description = "Basic blocklist description", + }); + ArmOperation lro = await raiBlocklistPropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + RaiBlocklistPropertiesBasicResource result = lro.Value; + + // 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 + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Bulk Rai Blocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task AddBulkConnectionRaiBlocklistItem_CreateBulkRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/addBulk.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_AddBulk" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + IEnumerable content = new RaiBlocklistItemBulkRequest[] + { +new RaiBlocklistItemBulkRequest() +{ +Name = "myblocklistitem1", +Properties = new RaiBlocklistItemProperties() +{ +IsRegex = true, +Pattern = "^[a-z0-9_-]{2,16}$", +}, +},new RaiBlocklistItemBulkRequest() +{ +Name = "myblocklistitem2", +Properties = new RaiBlocklistItemProperties() +{ +IsRegex = false, +Pattern = "blockwords", +}, +} + }; + ArmOperation> lro = await raiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItemAsync(WaitUntil.Completed, content); + IList result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Delete Bulk Rai Blocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeleteBulkConnectionRaiBlocklistItem_DeleteBulkRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/deleteBulk.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_DeleteBulk" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + BinaryData body = BinaryData.FromObjectAsJson(new object[] { "myblocklistitem1", "myblocklistitem2" }); + await raiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItemAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..847727a96ff37 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistPropertiesBasicResourceCollection + { + // List Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/list.json + // this example is just showing the usage of "ConnectionRaiBlocklists_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation and iterate over the result + await foreach (RaiBlocklistPropertiesBasicResource item in collection.GetAllAsync()) + { + // the variable item 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 + RaiBlocklistPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + RaiBlocklistPropertiesBasicResource result = await collection.GetAsync(raiBlocklistName); + + // 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 + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + bool result = await collection.ExistsAsync(raiBlocklistName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + NullableResponse response = await collection.GetIfExistsAsync(raiBlocklistName); + RaiBlocklistPropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/create.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + RaiBlocklistPropertiesBasicResourceData data = new RaiBlocklistPropertiesBasicResourceData(new RaiBlocklistProperties() + { + Description = "Basic blocklist description", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiBlocklistName, data); + RaiBlocklistPropertiesBasicResource result = lro.Value; + + // 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 + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobCollection.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs index 4c65a14f55ebf..50687d47e00fd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningLabelingJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs @@ -10,18 +10,19 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.MachineLearning.Samples { - public partial class Sample_MachineLearningLabelingJobCollection + public partial class Sample_ServerlessEndpointCollection { - // List Labeling Job. + // List Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListLabelingJob() + public async Task GetAll_ListWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/list.json - // this example is just showing the usage of "LabelingJobs_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/list.json + // this example is just showing the usage of "ServerlessEndpoints_List" 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(); @@ -31,20 +32,20 @@ public async Task GetAll_ListLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation and iterate over the result - await foreach (MachineLearningLabelingJobResource item in collection.GetAllAsync()) + await foreach (ServerlessEndpointResource item in collection.GetAllAsync()) { // the variable item 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 - MachineLearningLabelingJobData resourceData = item.Data; + ServerlessEndpointData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -52,13 +53,13 @@ public async Task GetAll_ListLabelingJob() Console.WriteLine($"Succeeded"); } - // Get Labeling Job. + // Get Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetLabelingJob() + public async Task Get_GetWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" 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,34 +69,32 @@ public async Task Get_GetLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - MachineLearningLabelingJobResource result = await collection.GetAsync(id, includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); + string name = "string"; + ServerlessEndpointResource result = await collection.GetAsync(name); // 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 - MachineLearningLabelingJobData resourceData = result.Data; + ServerlessEndpointData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Get Labeling Job. + // Get Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetLabelingJob() + public async Task Exists_GetWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" 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(); @@ -105,30 +104,28 @@ public async Task Exists_GetLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - bool result = await collection.ExistsAsync(id, includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); + string name = "string"; + bool result = await collection.ExistsAsync(name); Console.WriteLine($"Succeeded: {result}"); } - // Get Labeling Job. + // Get Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetLabelingJob() + public async Task GetIfExists_GetWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/get.json - // this example is just showing the usage of "LabelingJobs_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" 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(); @@ -138,20 +135,18 @@ public async Task GetIfExists_GetLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - bool? includeJobInstructions = true; - bool? includeLabelCategories = true; - NullableResponse response = await collection.GetIfExistsAsync(id, includeJobInstructions: includeJobInstructions, includeLabelCategories: includeLabelCategories); - MachineLearningLabelingJobResource result = response.HasValue ? response.Value : null; + string name = "string"; + NullableResponse response = await collection.GetIfExistsAsync(name); + ServerlessEndpointResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -161,19 +156,19 @@ public async Task GetIfExists_GetLabelingJob() { // 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 - MachineLearningLabelingJobData resourceData = result.Data; + ServerlessEndpointData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } } - // CreateOrUpdate Labeling Job. + // CreateOrUpdate Workspace Serverless Endpoint. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateLabelingJob() + public async Task CreateOrUpdate_CreateOrUpdateWorkspaceServerlessEndpoint() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/LabelingJob/createOrUpdate.json - // this example is just showing the usage of "LabelingJobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/createOrUpdate.json + // this example is just showing the usage of "ServerlessEndpoints_CreateOrUpdate" 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(); @@ -183,88 +178,47 @@ public async Task CreateOrUpdate_CreateOrUpdateLabelingJob() // this example assumes you already have this MachineLearningWorkspaceResource created on azure // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "workspace-1234"; - string workspaceName = "testworkspace"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); - // get the collection of this MachineLearningLabelingJobResource - MachineLearningLabelingJobCollection collection = machineLearningWorkspace.GetMachineLearningLabelingJobs(); + // get the collection of this ServerlessEndpointResource + ServerlessEndpointCollection collection = machineLearningWorkspace.GetServerlessEndpoints(); // invoke the operation - string id = "testLabelingJob"; - MachineLearningLabelingJobData data = new MachineLearningLabelingJobData(new LabelingJobProperties() + string name = "string"; + ServerlessEndpointData data = new ServerlessEndpointData(new AzureLocation("string"), new ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode.Key) { - JobInstructionsUri = new Uri("link/to/instructions"), - LabelCategories = -{ -["myCategory1"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory1Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -["myCategory2"] = new LabelCategory() -{ -Classes = -{ -["myLabelClass1"] = new LabelClass() -{ -DisplayName = "myLabelClass1", -Subclasses = -{ -}, -}, -["myLabelClass2"] = new LabelClass() -{ -DisplayName = "myLabelClass2", -Subclasses = -{ -}, -}, -}, -DisplayName = "myCategory2Title", -MultiSelect = LabelCategoryMultiSelect.Disabled, -}, -}, - LabelingJobMediaProperties = new LabelingJobImageProperties(), - MlAssistConfiguration = new MachineLearningAssistEnabledConfiguration("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/myscoringcompute", "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/computes/mytrainingompute"), - Description = "string", - Properties = + ContentSafetyStatus = ContentSafetyStatus.Enabled, + ModelId = "string", + }) + { + Identity = new ManagedServiceIdentity("SystemAssigned") + { + UserAssignedIdentities = { -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), }, + }, + Kind = "string", + Sku = new MachineLearningSku("string") + { + Tier = MachineLearningSkuTier.Standard, + Size = "string", + Family = "string", + Capacity = 1, + }, Tags = { -["additionalProp1"] = "string", -["additionalProp2"] = "string", -["additionalProp3"] = "string", }, - }); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, id, data); - MachineLearningLabelingJobResource result = lro.Value; + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + ServerlessEndpointResource result = lro.Value; // 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 - MachineLearningLabelingJobData resourceData = result.Data; + ServerlessEndpointData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs new file mode 100644 index 0000000000000..da4aa896773a2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_ServerlessEndpointResource + { + // Delete Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/delete.json + // this example is just showing the usage of "ServerlessEndpoints_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + await serverlessEndpoint.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json + // this example is just showing the usage of "ServerlessEndpoints_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + ServerlessEndpointResource result = await serverlessEndpoint.GetAsync(); + + // 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 + ServerlessEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/update.json + // this example is just showing the usage of "ServerlessEndpoints_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + ServerlessEndpointPatch patch = new ServerlessEndpointPatch() + { + Identity = new MachineLearningPartialManagedServiceIdentity() + { + ManagedServiceIdentityType = "None", + UserAssignedIdentities = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +}), +}, + }, + Sku = new MachineLearningSkuPatch() + { + Capacity = 1, + Family = "string", + Name = "string", + Size = "string", + Tier = MachineLearningSkuTier.Premium, + }, + Tags = +{ +}, + }; + ArmOperation lro = await serverlessEndpoint.UpdateAsync(WaitUntil.Completed, patch); + ServerlessEndpointResource result = lro.Value; + + // 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 + ServerlessEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ListKeys Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetKeys_ListKeysWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/listKeys.json + // this example is just showing the usage of "ServerlessEndpoints_ListKeys" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + MachineLearningEndpointAuthKeys result = await serverlessEndpoint.GetKeysAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // RegenerateKeys Workspace Serverless Endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RegenerateKeys_RegenerateKeysWorkspaceServerlessEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/regenerateKeys.json + // this example is just showing the usage of "ServerlessEndpoints_RegenerateKeys" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerlessEndpointResource created on azure + // for more information of creating ServerlessEndpointResource, please refer to the document of ServerlessEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string name = "string"; + ResourceIdentifier serverlessEndpointResourceId = ServerlessEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, name); + ServerlessEndpointResource serverlessEndpoint = client.GetServerlessEndpointResource(serverlessEndpointResourceId); + + // invoke the operation + MachineLearningEndpointKeyRegenerateContent content = new MachineLearningEndpointKeyRegenerateContent(MachineLearningKeyType.Primary) + { + KeyValue = "string", + }; + ArmOperation lro = await serverlessEndpoint.RegenerateKeysAsync(WaitUntil.Completed, content); + MachineLearningEndpointAuthKeys result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 94b10f612e537..d6919254119fb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningUsages_ListUsages() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Usage/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Usage/list.json // this example is just showing the usage of "Usages_List" 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 @@ -50,7 +50,7 @@ public async Task GetMachineLearningUsages_ListUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningVmSizes_ListVMSizes() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/VirtualMachineSize/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/VirtualMachineSize/list.json // this example is just showing the usage of "VirtualMachineSizes_List" 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 @@ -79,7 +79,7 @@ public async Task GetMachineLearningVmSizes_ListVMSizes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateMachineLearningQuotas_UpdateQuotas() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Quota/update.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Quota/update.json // this example is just showing the usage of "Quotas_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 @@ -127,7 +127,7 @@ public async Task UpdateMachineLearningQuotas_UpdateQuotas() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningQuotas_ListWorkspaceQuotasByVMFamily() { - // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/examples/Quota/list.json + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Quota/list.json // this example is just showing the usage of "Quotas_List" 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 diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs new file mode 100644 index 0000000000000..48708c1f0bdf4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionDeploymentCollection + { + // List Azure OpenAI Connection Deployments + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAzureOpenAIConnectionDeployments() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listDeployments.json + // this example is just showing the usage of "Connection_ListDeployments" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceConnectionDeploymentResource item in collection.GetAllAsync()) + { + // the variable item 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + WorkspaceConnectionDeploymentResource result = await collection.GetAsync(deploymentName); + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + WorkspaceConnectionDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/createDeployment.json + // this example is just showing the usage of "Connection_CreateOrUpdateDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + WorkspaceConnectionDeploymentResource result = lro.Value; + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs new file mode 100644 index 0000000000000..65151803829b0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionDeploymentResource + { + // Delete Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/deleteDeployment.json + // this example is just showing the usage of "Connection_DeleteDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string deploymentName = "testDeploymentName"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + await workspaceConnectionDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + WorkspaceConnectionDeploymentResource result = await workspaceConnectionDeployment.GetAsync(); + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/createDeployment.json + // this example is just showing the usage of "Connection_CreateOrUpdateDeployment" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await workspaceConnectionDeployment.UpdateAsync(WaitUntil.Completed, data); + WorkspaceConnectionDeploymentResource result = lro.Value; + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs new file mode 100644 index 0000000000000..4236bdc5d3e92 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionRaiPolicyCollection + { + // List Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/list.json + // this example is just showing the usage of "ConnectionRaiPolicies_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceConnectionRaiPolicyResource item in collection.GetAllAsync()) + { + // the variable item 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 + RaiPolicyPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + WorkspaceConnectionRaiPolicyResource result = await collection.GetAsync(raiPolicyName); + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + bool result = await collection.ExistsAsync(raiPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + NullableResponse response = await collection.GetIfExistsAsync(raiPolicyName); + WorkspaceConnectionRaiPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/create.json + // this example is just showing the usage of "ConnectionRaiPolicy_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiPolicyName, data); + WorkspaceConnectionRaiPolicyResource result = lro.Value; + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs new file mode 100644 index 0000000000000..3c41b9d3979ac --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionRaiPolicyResource + { + // Delete Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/delete.json + // this example is just showing the usage of "ConnectionRaiPolicy_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + await workspaceConnectionRaiPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + WorkspaceConnectionRaiPolicyResource result = await workspaceConnectionRaiPolicy.GetAsync(); + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/create.json + // this example is just showing the usage of "ConnectionRaiPolicy_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await workspaceConnectionRaiPolicy.UpdateAsync(WaitUntil.Completed, data); + WorkspaceConnectionRaiPolicyResource result = lro.Value; + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs new file mode 100644 index 0000000000000..680856af5281c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointDeploymentCollection + { + // Get Endpoint Deployments + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetEndpointDeployments() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/getDeployments.json + // this example is just showing the usage of "EndpointDeployment_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointDeploymentResource item in collection.GetAllAsync()) + { + // the variable item 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + WorkspaceEndpointDeploymentResource result = await collection.GetAsync(deploymentName); + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + WorkspaceEndpointDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/create.json + // this example is just showing the usage of "EndpointDeployment_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + WorkspaceEndpointDeploymentResource result = lro.Value; + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs new file mode 100644 index 0000000000000..c1101097e97ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointDeploymentResource + { + // Delete Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/delete.json + // this example is just showing the usage of "EndpointDeployment_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "testDeploymentName"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + await workspaceEndpointDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + WorkspaceEndpointDeploymentResource result = await workspaceEndpointDeployment.GetAsync(); + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/create.json + // this example is just showing the usage of "EndpointDeployment_CreateOrUpdate" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await workspaceEndpointDeployment.UpdateAsync(WaitUntil.Completed, data); + WorkspaceEndpointDeploymentResource result = lro.Value; + + // 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 + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs new file mode 100644 index 0000000000000..105749e74d20c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointRaiPolicyCollection + { + // List Rai policies + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiPolicies() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/list.json + // this example is just showing the usage of "RaiPolicies_List" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointRaiPolicyResource item in collection.GetAllAsync()) + { + // the variable item 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 + RaiPolicyPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + WorkspaceEndpointRaiPolicyResource result = await collection.GetAsync(raiPolicyName); + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + bool result = await collection.ExistsAsync(raiPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + NullableResponse response = await collection.GetIfExistsAsync(raiPolicyName); + WorkspaceEndpointRaiPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/create.json + // this example is just showing the usage of "RaiPolicy_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiPolicyName, data); + WorkspaceEndpointRaiPolicyResource result = lro.Value; + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs new file mode 100644 index 0000000000000..fc3d2ae838bc8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointRaiPolicyResource + { + // Delete Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/delete.json + // this example is just showing the usage of "RaiPolicy_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + await workspaceEndpointRaiPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + WorkspaceEndpointRaiPolicyResource result = await workspaceEndpointRaiPolicy.GetAsync(); + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/create.json + // this example is just showing the usage of "RaiPolicy_Create" 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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await workspaceEndpointRaiPolicy.UpdateAsync(WaitUntil.Completed, data); + WorkspaceEndpointRaiPolicyResource result = lro.Value; + + // 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 + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs index 3b76d382ae248..a99378494fec9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs @@ -327,13 +327,12 @@ public static MachineLearningCodeVersionData MachineLearningCodeVersionData(Reso /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Uri where code is located. /// Provisioning state for the code version. /// A new instance for mocking. - public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -343,7 +342,6 @@ public static MachineLearningCodeVersionProperties MachineLearningCodeVersionPro properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, codeUri, @@ -442,17 +440,15 @@ public static MachineLearningComponentVersionData MachineLearningComponentVersio /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// /// Defines Component definition details. /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> /// /// Provisioning state for the component version. - /// Stage in the component lifecycle. /// A new instance for mocking. - public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -462,12 +458,10 @@ public static MachineLearningComponentVersionProperties MachineLearningComponent properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, componentSpec, - provisioningState, - stage); + provisioningState); } /// Initializes a new instance of . @@ -535,6 +529,28 @@ public static MachineLearningDataVersionData MachineLearningDataVersionData(Reso serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Blob reference for consumption details. + /// A new instance for mocking. + public static GetBlobReferenceSasResponseDto GetBlobReferenceSasResponseDto(GetBlobReferenceForConsumptionDto blobReferenceForConsumption = null) + { + return new GetBlobReferenceSasResponseDto(blobReferenceForConsumption, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// The ARM id of the storage account. + /// A new instance for mocking. + public static GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(Uri blobUri = null, DataReferenceCredential credential = null, string storageAccountArmId = null) + { + return new GetBlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -600,9 +616,8 @@ public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVe /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Defines if image needs to be rebuilt based on base image changes. /// Configuration settings for Docker build context. /// @@ -618,12 +633,11 @@ public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVe /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// /// Defines configuration specific to inference. - /// Intellectual Property details. Used if environment is an Intellectual Property. /// The OS type of the environment. /// Provisioning state for the environment version. /// Stage in the environment lifecycle assigned to this environment. /// A new instance for mocking. - public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, AutoRebuildSetting? autoRebuild = null, MachineLearningBuildContext build = null, string condaFile = null, MachineLearningEnvironmentType? environmentType = null, string image = null, MachineLearningInferenceContainerProperties inferenceConfig = null, IntellectualProperty intellectualProperty = null, MachineLearningOperatingSystemType? osType = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, AutoRebuildSetting? autoRebuild = null, MachineLearningBuildContext build = null, string condaFile = null, MachineLearningEnvironmentType? environmentType = null, string image = null, MachineLearningInferenceContainerProperties inferenceConfig = null, MachineLearningOperatingSystemType? osType = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -633,7 +647,6 @@ public static MachineLearningEnvironmentVersionProperties MachineLearningEnviron properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, autoRebuild, @@ -642,12 +655,50 @@ public static MachineLearningEnvironmentVersionProperties MachineLearningEnviron environmentType, image, inferenceConfig, - intellectualProperty, osType, provisioningState, stage); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MarketplaceSubscriptionData MarketplaceSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MarketplaceSubscriptionProperties properties = null) + { + return new MarketplaceSubscriptionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Provisioning State of the Marketplace Subscription. + /// A new instance for mocking. + public static MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(MarketplacePlan marketplacePlan = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, string modelId = null, MarketplaceSubscriptionProvisioningState? provisioningState = null) + { + return new MarketplaceSubscriptionProperties(marketplacePlan, marketplaceSubscriptionStatus, modelId, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. + /// A new instance for mocking. + public static MarketplacePlan MarketplacePlan(string offerId = null, string planId = null, string publisherId = null) + { + return new MarketplacePlan(offerId, planId, publisherId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -713,18 +764,16 @@ public static MachineLearningModelVersionData MachineLearningModelVersionData(Re /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Mapping of model flavors to their properties. - /// Intellectual Property details. Used if model is an Intellectual Property. /// Name of the training job which produced this model. /// The storage format for this entity. Used for NCD. /// The URI path to the model contents. /// Provisioning state for the model version. /// Stage in the model lifecycle assigned to this model. /// A new instance for mocking. - public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, IDictionary flavors = null, IntellectualProperty intellectualProperty = null, string jobName = null, string modelType = null, Uri modelUri = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IDictionary flavors = null, string jobName = null, string modelType = null, Uri modelUri = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -735,11 +784,9 @@ public static MachineLearningModelVersionProperties MachineLearningModelVersionP properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, flavors, - intellectualProperty, jobName, modelType, modelUri, @@ -747,80 +794,6 @@ public static MachineLearningModelVersionProperties MachineLearningModelVersionP stage); } - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Collection of environment variables. - /// - /// [Required] Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// Collection of inputs. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// [Required] Arm ID of the target environment to be created by package operation. - /// A new instance for mocking. - public static ModelPackageContent ModelPackageContent(BaseEnvironmentSource baseEnvironmentSource = null, IDictionary environmentVariables = null, InferencingServer inferencingServer = null, IEnumerable inputs = null, ModelConfiguration modelConfiguration = null, IDictionary tags = null, string targetEnvironmentId = null) - { - environmentVariables ??= new Dictionary(); - inputs ??= new List(); - tags ??= new Dictionary(); - - return new ModelPackageContent( - baseEnvironmentSource, - environmentVariables, - inferencingServer, - inputs?.ToList(), - modelConfiguration, - tags, - targetEnvironmentId, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Build id of the image build operation. - /// Build state of the image build operation. - /// Collection of environment variables. - /// - /// Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// Collection of inputs. - /// Log url of the image build operation. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Asset ID of the target environment created by package operation. - /// A new instance for mocking. - public static ModelPackageResult ModelPackageResult(BaseEnvironmentSource baseEnvironmentSource = null, string buildId = null, PackageBuildState? buildState = null, IReadOnlyDictionary environmentVariables = null, InferencingServer inferencingServer = null, IEnumerable inputs = null, Uri logUri = null, ModelConfiguration modelConfiguration = null, IReadOnlyDictionary tags = null, string targetEnvironmentId = null) - { - environmentVariables ??= new Dictionary(); - inputs ??= new List(); - tags ??= new Dictionary(); - - return new ModelPackageResult( - baseEnvironmentSource, - buildId, - buildState, - environmentVariables, - inferencingServer, - inputs?.ToList(), - logUri, - modelConfiguration, - tags, - targetEnvironmentId, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -938,7 +911,7 @@ public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentD /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Compute target for batch inference operation. @@ -1012,7 +985,7 @@ public static MachineLearningBatchDeploymentProperties MachineLearningBatchDeplo /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// /// A new instance for mocking. public static MachineLearningDatastoreData MachineLearningDatastoreData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningDatastoreProperties properties = null) @@ -1033,13 +1006,12 @@ public static MachineLearningDatastoreData MachineLearningDatastoreData(Resource /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// A new instance for mocking. - public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null) + public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, bool? isDefault = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -1051,7 +1023,6 @@ public static MachineLearningDatastoreProperties MachineLearningDatastorePropert serializedAdditionalRawData: null, credentials, datastoreType == null ? default : new DatastoreType(datastoreType), - intellectualProperty, isDefault); } @@ -1138,16 +1109,15 @@ public static MachineLearningFeatureSetVersionData MachineLearningFeatureSetVers /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies list of entities. /// Specifies the materialization settings. /// Provisioning state for the featureset version container. /// Specifies the feature spec details. /// Specifies the asset stage. /// A new instance for mocking. - public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable entities = null, MaterializationSettings materializationSettings = null, RegistryAssetProvisioningState? provisioningState = null, string specificationPath = null, string stage = null) + public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable entities = null, MaterializationSettings materializationSettings = null, RegistryAssetProvisioningState? provisioningState = null, string specificationPath = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -1158,7 +1128,6 @@ public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureS properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, entities?.ToList(), @@ -1168,32 +1137,14 @@ public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureS stage); } - /// Initializes a new instance of . - /// Specifies the created date. - /// Specifies the display name. - /// Specifies the duration. - /// Specifies the experiment id. - /// Specifies the backfill feature window to be materialized. - /// Specifies the job id. - /// Specifies the job status. - /// Specifies the tags if any. - /// Specifies the feature store job type. - /// A new instance for mocking. - public static MachineLearningFeatureSetJob MachineLearningFeatureSetJob(DateTimeOffset? createdOn = null, string displayName = null, TimeSpan? duration = null, string experimentId = null, FeatureWindow featureWindow = null, string jobId = null, MachineLearningJobStatus? status = null, IReadOnlyDictionary tags = null, FeatureStoreJobType? featureStoreJobType = null) + /// Initializes a new instance of . + /// List of jobs submitted as part of the backfill request. + /// A new instance for mocking. + public static FeaturesetVersionBackfillResponse FeaturesetVersionBackfillResponse(IEnumerable jobIds = null) { - tags ??= new Dictionary(); + jobIds ??= new List(); - return new MachineLearningFeatureSetJob( - createdOn, - displayName, - duration, - experimentId, - featureWindow, - jobId, - status, - tags, - featureStoreJobType, - serializedAdditionalRawData: null); + return new FeaturesetVersionBackfillResponse(jobIds?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -1261,14 +1212,13 @@ public static MachineLearningFeaturestoreEntityVersionData MachineLearningFeatur /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies index columns. /// Provisioning state for the featurestore entity version. /// Specifies the asset stage. /// A new instance for mocking. - public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, AutoDeleteSetting autoDeleteSetting = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable indexColumns = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable indexColumns = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -1279,7 +1229,6 @@ public static MachineLearningFeatureStoreEntityVersionProperties MachineLearning properties, tags, serializedAdditionalRawData: null, - autoDeleteSetting, isAnonymous, isArchived, indexColumns?.ToList(), @@ -1295,7 +1244,7 @@ public static MachineLearningFeatureStoreEntityVersionProperties MachineLearning /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// A new instance for mocking. public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningJobProperties properties = null) @@ -1326,18 +1275,16 @@ public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier i /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. /// A new instance for mocking. - public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, string jobType = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null) + public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, string jobType = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); return new MachineLearningJobProperties( @@ -1353,7 +1300,6 @@ public static MachineLearningJobProperties MachineLearningJobProperties(string d isArchived, jobType == null ? default : new JobType(jobType), notificationSetting, - secretsConfiguration, services, status); } @@ -1368,7 +1314,7 @@ public static MachineLearningJobProperties MachineLearningJobProperties(string d /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - /// Port for endpoint set by user. + /// Port for endpoint. /// Additional properties to set on the endpoint. /// Status of endpoint. /// A new instance for mocking. @@ -1387,142 +1333,6 @@ public static MachineLearningJobService MachineLearningJobService(string endpoin serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// [Required] Additional attributes of the entity. - /// A new instance for mocking. - public static MachineLearningLabelingJobData MachineLearningLabelingJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, LabelingJobProperties properties = null) - { - return new MachineLearningLabelingJobData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// ARM resource ID of the component resource. - /// ARM resource ID of the compute resource. - /// Display name of job. - /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. - /// - /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. - /// Defaults to AmlToken if null. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Is the asset archived?. - /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. - /// - /// List of JobEndpoints. - /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - /// - /// Status of the job. - /// Created time of the job in UTC timezone. - /// Configuration of data used in the job. - /// Labeling instructions of the job. - /// Label categories of the job. - /// - /// Media type specific properties in the job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// - /// Configuration of MLAssist feature in the job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Progress metrics of the job. - /// Internal id of the job(Previously called project). - /// Specifies the labeling job provisioning state. - /// Status messages of the job. - /// A new instance for mocking. - public static LabelingJobProperties LabelingJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, DateTimeOffset? createdOn = null, LabelingDataConfiguration dataConfiguration = null, Uri jobInstructionsUri = null, IDictionary labelCategories = null, LabelingJobMediaProperties labelingJobMediaProperties = null, MachineLearningAssistConfiguration mlAssistConfiguration = null, ProgressMetrics progressMetrics = null, Guid? projectId = null, JobProvisioningState? provisioningState = null, IEnumerable statusMessages = null) - { - properties ??= new Dictionary(); - tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); - services ??= new Dictionary(); - labelCategories ??= new Dictionary(); - statusMessages ??= new List(); - - return new LabelingJobProperties( - description, - properties, - tags, - serializedAdditionalRawData: null, - componentId, - computeId, - displayName, - experimentName, - identity, - isArchived, - JobType.Labeling, - notificationSetting, - secretsConfiguration, - services, - status, - createdOn, - dataConfiguration, - jobInstructionsUri != null ? new LabelingJobInstructions(jobInstructionsUri, serializedAdditionalRawData: null) : null, - labelCategories, - labelingJobMediaProperties, - mlAssistConfiguration, - progressMetrics, - projectId, - provisioningState, - statusMessages?.ToList()); - } - - /// Initializes a new instance of . - /// The completed datapoint count. - /// The time of last successful incremental data refresh in UTC. - /// The skipped datapoint count. - /// The total datapoint count. - /// A new instance for mocking. - public static ProgressMetrics ProgressMetrics(long? completedDatapointCount = null, DateTimeOffset? incrementalDataLastRefreshOn = null, long? skippedDatapointCount = null, long? totalDatapointCount = null) - { - return new ProgressMetrics(completedDatapointCount, incrementalDataLastRefreshOn, skippedDatapointCount, totalDatapointCount, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Service-defined message code. - /// Time in UTC at which the message was created. - /// Severity level of message. - /// A human-readable representation of the message code. - /// A new instance for mocking. - public static JobStatusMessage JobStatusMessage(string code = null, DateTimeOffset? createdOn = null, JobStatusMessageLevel? level = null, string message = null) - { - return new JobStatusMessage(code, createdOn, level, message, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// A new instance for mocking. - public static ExportSummary ExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string format = null, string labelingJobId = null, DateTimeOffset? startOn = null) - { - return new UnknownExportSummary( - endOn, - exportedRowCount, - format == null ? default : new ExportFormatType(format), - labelingJobId, - startOn, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1630,7 +1440,7 @@ public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymen /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// If true, enables Application Insights logging. @@ -1762,7 +1572,7 @@ public static MachineLearningScheduleData MachineLearningScheduleData(ResourceId /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// Display name of schedule. /// Is the schedule enabled?. @@ -1790,6 +1600,69 @@ public static MachineLearningScheduleProperties MachineLearningSchedulePropertie trigger); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static ServerlessEndpointData ServerlessEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, ServerlessEndpointProperties properties = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new ServerlessEndpointData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + kind, + properties, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// [Required] Specifies the authentication mode for the Serverless endpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// The current state of the ServerlessEndpoint. + /// The inference uri to target when making requests against the serverless endpoint. + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// Provisioning state for the endpoint. + /// A new instance for mocking. + public static ServerlessEndpointProperties ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode = default, ContentSafetyStatus? contentSafetyStatus = null, ServerlessEndpointState? endpointState = null, ServerlessInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, string modelId = null, MachineLearningEndpointProvisioningState? provisioningState = null) + { + return new ServerlessEndpointProperties( + authMode, + contentSafetyStatus.HasValue ? new ContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + modelId != null ? new ModelSettings(modelId, serializedAdditionalRawData: null) : null, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies any required headers to target this serverless endpoint. + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// A new instance for mocking. + public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(IReadOnlyDictionary headers = null, Uri uri = null) + { + headers ??= new Dictionary(); + + return new ServerlessInferenceEndpoint(headers, uri, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -1803,18 +1676,20 @@ public static MachineLearningScheduleProperties MachineLearningSchedulePropertie /// Discovery URL for the Registry. /// IntellectualPropertyPublisher for the registry. /// ResourceId of the managed RG if the registry has system created resources. + /// Managed resource group specific settings. /// MLFlow Registry URI for the Registry. - /// Private endpoint connections info used for pending connections in private link portal. + /// Private endpoint connections info used for pending connections in private link portal. /// /// Is the Registry accessible from the internet? /// Possible values: "Enabled" or "Disabled" /// /// Details of each region the registry is in. /// A new instance for mocking. - public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, Uri mlFlowRegistryUri = null, IEnumerable privateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) + public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, IEnumerable managedResourceGroupAssignedIdentities = null, Uri mlFlowRegistryUri = null, IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) { tags ??= new Dictionary(); - privateEndpointConnections ??= new List(); + managedResourceGroupAssignedIdentities ??= new List(); + registryPrivateEndpointConnections ??= new List(); regionDetails ??= new List(); return new MachineLearningRegistryData( @@ -1830,13 +1705,22 @@ public static MachineLearningRegistryData MachineLearningRegistryData(ResourceId discoveryUri, intellectualPropertyPublisher, managedResourceId != null ? new ArmResourceId(managedResourceId, serializedAdditionalRawData: null) : null, + managedResourceGroupAssignedIdentities != null ? new ManagedResourceGroupSettings(managedResourceGroupAssignedIdentities?.ToList(), serializedAdditionalRawData: null) : null, mlFlowRegistryUri, - privateEndpointConnections?.ToList(), + registryPrivateEndpointConnections?.ToList(), publicNetworkAccess, regionDetails?.ToList(), serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Identity principal Id. + /// A new instance for mocking. + public static ManagedResourceGroupAssignedIdentities ManagedResourceGroupAssignedIdentities(Guid? principalId = null) + { + return new ManagedResourceGroupAssignedIdentities(principalId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The ARM identifier for Private Endpoint. /// The subnetId that the private endpoint is connected to. @@ -1875,6 +1759,7 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. /// The flag to indicate whether to allow public access when behind VNet. + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. /// ARM id of the application insights associated with this workspace. /// /// @@ -1882,6 +1767,9 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// The description of this workspace. /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. /// + /// + /// Flag to tell if simplified CMK should be enabled for this workspace. + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. /// /// /// Settings for feature store type workspace. @@ -1889,6 +1777,7 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. /// /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. /// /// Managed Network settings for a machine learning workspace. @@ -1899,6 +1788,7 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// Count of private connections in the workspace. /// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. /// The service managed resource settings. /// The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace. /// The list of shared private link resources in this workspace. @@ -1912,12 +1802,13 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = /// WorkspaceHub's configuration object. /// The immutable id associated with this workspace. /// A new instance for mocking. - public static MachineLearningWorkspaceData MachineLearningWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = null, string applicationInsights = null, IEnumerable associatedWorkspaces = null, IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, Uri discoveryUri = null, bool? enableDataIsolation = null, MachineLearningEncryptionSetting encryption = null, IEnumerable existingWorkspaces = null, FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = null, ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, string keyVault = null, IEnumerable keyVaults = null, ManagedNetworkSettings managedNetwork = null, Uri mlFlowTrackingUri = null, MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, IEnumerable privateEndpointConnections = null, int? privateLinkCount = null, MachineLearningProvisioningState? provisioningState = null, MachineLearningPublicNetworkAccessType? publicNetworkAccessType = null, int? cosmosDbCollectionsThroughput = null, string serviceProvisionedResourceGroup = null, IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = null, string storageAccount = null, IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = null, string systemDatastoresAuthMode = null, Guid? tenantId = null, bool? isV1LegacyMode = null, WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) + public static MachineLearningWorkspaceData MachineLearningWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = null, bool? allowRoleAssignmentOnRG = null, string applicationInsights = null, IEnumerable associatedWorkspaces = null, IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, Uri discoveryUri = null, bool? enableDataIsolation = null, bool? enableServiceSideCMKEncryption = null, bool? enableSimplifiedCmk = null, bool? enableSoftwareBillOfMaterials = null, MachineLearningEncryptionSetting encryption = null, IEnumerable existingWorkspaces = null, FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = null, ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, IEnumerable ipAllowlist = null, string keyVault = null, IEnumerable keyVaults = null, ManagedNetworkSettings managedNetwork = null, Uri mlFlowTrackingUri = null, MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, IEnumerable privateEndpointConnections = null, int? privateLinkCount = null, MachineLearningProvisioningState? provisioningState = null, MachineLearningPublicNetworkAccessType? publicNetworkAccessType = null, ServerlessComputeSettings serverlessComputeSettings = null, int? cosmosDbCollectionsThroughput = null, string serviceProvisionedResourceGroup = null, IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = null, string storageAccount = null, IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = null, string systemDatastoresAuthMode = null, Guid? tenantId = null, bool? isV1LegacyMode = null, WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) { tags ??= new Dictionary(); associatedWorkspaces ??= new List(); containerRegistries ??= new List(); existingWorkspaces ??= new List(); + ipAllowlist ??= new List(); keyVaults ??= new List(); privateEndpointConnections ??= new List(); sharedPrivateLinkResources ??= new List(); @@ -1934,6 +1825,7 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource kind, sku, allowPublicAccessWhenBehindVnet, + allowRoleAssignmentOnRG, applicationInsights, associatedWorkspaces?.ToList(), containerRegistries?.ToList(), @@ -1941,6 +1833,9 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource description, discoveryUri, enableDataIsolation, + enableServiceSideCMKEncryption, + enableSimplifiedCmk, + enableSoftwareBillOfMaterials, encryption, existingWorkspaces?.ToList(), featureStoreSettings, @@ -1948,6 +1843,7 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource isHbiWorkspace, hubResourceId, imageBuildCompute, + ipAllowlist?.ToList(), keyVault, keyVaults?.ToList(), managedNetwork, @@ -1958,6 +1854,7 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource privateLinkCount, provisioningState, publicNetworkAccessType, + serverlessComputeSettings, cosmosDbCollectionsThroughput != null ? new ServiceManagedResourcesSettings(new CosmosDbSettings(cosmosDbCollectionsThroughput, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, serviceProvisionedResourceGroup, sharedPrivateLinkResources?.ToList(), @@ -1978,16 +1875,37 @@ public static MachineLearningWorkspaceData MachineLearningWorkspaceData(Resource /// /// /// Dictionary of <OutboundRule> - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . /// /// Status of the Provisioning for the managed network of a machine learning workspace. + /// /// A new instance for mocking. - public static ManagedNetworkSettings ManagedNetworkSettings(IsolationMode? isolationMode = null, string networkId = null, IDictionary outboundRules = null, ManagedNetworkProvisionStatus status = null) + public static ManagedNetworkSettings ManagedNetworkSettings(IsolationMode? isolationMode = null, string networkId = null, IDictionary outboundRules = null, ManagedNetworkProvisionStatus status = null, IEnumerable changeableIsolationModes = null) { outboundRules ??= new Dictionary(); + changeableIsolationModes ??= new List(); - return new ManagedNetworkSettings(isolationMode, networkId, outboundRules, status, serializedAdditionalRawData: null); + return new ManagedNetworkSettings( + isolationMode, + networkId, + outboundRules, + status, + changeableIsolationModes?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// A new instance for mocking. + public static MachineLearningOutboundRule MachineLearningOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, string outboundRuleType = null) + { + parentRuleNames ??= new List(); + + return new UnknownOutboundRule(category, parentRuleNames?.ToList(), status, outboundRuleType == null ? default : new OutboundRuleType(outboundRuleType), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2057,8 +1975,8 @@ public static MachineLearningPrivateEndpoint MachineLearningPrivateEndpoint(Reso /// The resourceType. /// The systemData. /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , and . /// /// A new instance for mocking. public static MachineLearningWorkspaceConnectionData MachineLearningWorkspaceConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningWorkspaceConnectionProperties properties = null) @@ -2072,6 +1990,246 @@ public static MachineLearningWorkspaceConnectionData MachineLearningWorkspaceCon serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new UnknownWorkspaceConnectionPropertiesV2( + authType == null ? default : new MachineLearningConnectionAuthType(authType), + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static EndpointDeploymentResourcePropertiesBasicResourceData EndpointDeploymentResourcePropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointDeploymentResourceProperties properties = null) + { + return new EndpointDeploymentResourcePropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// A new instance for mocking. + public static EndpointDeploymentResourceProperties EndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, string endpointDeploymentResourcePropertiesType = null) + { + return new UnknownEndpointDeploymentResourceProperties(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The capabilities. + /// + /// The capabilities for finetune models. + /// Deployment model format. + /// If the model is default version. + /// Model lifecycle status. + /// The max capacity. + /// Deployment model name. + /// The list of Model Sku. + /// Metadata pertaining to creation and last modification of the resource. + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + /// A new instance for mocking. + public static EndpointModelProperties EndpointModelProperties(IReadOnlyDictionary capabilities = null, EndpointModelDeprecationProperties deprecation = null, IReadOnlyDictionary finetuneCapabilities = null, string format = null, bool? isDefaultVersion = null, ModelLifecycleStatus? lifecycleStatus = null, int? maxCapacity = null, string name = null, IEnumerable skus = null, SystemData systemData = null, string version = null) + { + capabilities ??= new Dictionary(); + finetuneCapabilities ??= new Dictionary(); + skus ??= new List(); + + return new EndpointModelProperties( + capabilities, + deprecation, + finetuneCapabilities, + format, + isDefaultVersion, + lifecycleStatus, + maxCapacity, + name, + skus?.ToList(), + systemData, + version, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The datetime of deprecation of the fineTune Model. + /// The datetime of deprecation of the inference Model. + /// A new instance for mocking. + public static EndpointModelDeprecationProperties EndpointModelDeprecationProperties(DateTimeOffset? fineTune = null, DateTimeOffset? inference = null) + { + return new EndpointModelDeprecationProperties(fineTune, inference, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The list of ARM id for the connection support this SKU. + /// The datetime of deprecation of the model SKU. + /// The name of the model SKU. + /// + /// The usage name of the model SKU. + /// A new instance for mocking. + public static EndpointModelSkuProperties EndpointModelSkuProperties(EndpointModelSkuCapacityProperties capacity = null, IEnumerable connectionIds = null, DateTimeOffset? deprecationOn = null, string name = null, IEnumerable rateLimits = null, string usageName = null) + { + connectionIds ??= new List(); + rateLimits ??= new List(); + + return new EndpointModelSkuProperties( + capacity, + connectionIds?.ToList(), + deprecationOn, + name, + rateLimits?.ToList(), + usageName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The default capacity. + /// The maximum capacity. + /// A new instance for mocking. + public static EndpointModelSkuCapacityProperties EndpointModelSkuCapacityProperties(int? @default = null, int? maximum = null) + { + return new EndpointModelSkuCapacityProperties(@default, maximum, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The count value of Call Rate Limit. + /// The renewal period in seconds of Call Rate Limit. + /// The call rate limit for the model. + /// A new instance for mocking. + public static EndpointModelSkuRateLimitProperties EndpointModelSkuRateLimitProperties(float? count = null, float? renewalPeriod = null, IEnumerable rules = null) + { + rules ??= new List(); + + return new EndpointModelSkuRateLimitProperties(count, renewalPeriod, rules?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// If the dynamic throttling is enabled. + /// + /// + /// + /// + /// A new instance for mocking. + public static EndpointModelSkuRateLimitRuleProperties EndpointModelSkuRateLimitRuleProperties(float? count = null, bool? dynamicThrottlingEnabled = null, string key = null, IEnumerable matchPatterns = null, float? minCount = null, float? renewalPeriod = null) + { + matchPatterns ??= new List(); + + return new EndpointModelSkuRateLimitRuleProperties( + count, + dynamicThrottlingEnabled, + key, + matchPatterns?.ToList(), + minCount, + renewalPeriod, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static EndpointModelSkuRateLimitRulePatternProperties EndpointModelSkuRateLimitRulePatternProperties(string method = null, string path = null) + { + return new EndpointModelSkuRateLimitRulePatternProperties(method, path, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist properties. + /// A new instance for mocking. + public static RaiBlocklistPropertiesBasicResourceData RaiBlocklistPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string raiBlocklistDescription = null) + { + return new RaiBlocklistPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + raiBlocklistDescription != null ? new RaiBlocklistProperties(raiBlocklistDescription, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist Item properties. + /// A new instance for mocking. + public static RaiBlocklistItemPropertiesBasicResourceData RaiBlocklistItemPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RaiBlocklistItemProperties properties = null) + { + return new RaiBlocklistItemPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure OpenAI Content Filters properties. + /// A new instance for mocking. + public static RaiPolicyPropertiesBasicResourceData RaiPolicyPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RaiPolicyProperties properties = null) + { + return new RaiPolicyPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// /// A new instance for mocking. @@ -2126,6 +2284,77 @@ public static MachineLearningDiagnoseResult MachineLearningDiagnoseResult(string return new MachineLearningDiagnoseResult(code, level, message, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A new instance for mocking. + public static EndpointResourcePropertiesBasicResourceData EndpointResourcePropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointResourceProperties properties = null) + { + return new EndpointResourcePropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static EndpointResourceProperties EndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, string endpointType = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new UnknownEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + endpointType == null ? default : new EndpointType(endpointType), + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Dictionary of Keys for the endpoint. + /// A new instance for mocking. + public static EndpointKeys EndpointKeys(AccountApiKeys keys = null) + { + return new EndpointKeys(keys, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static AccountApiKeys AccountApiKeys(string key1 = null, string key2 = null) + { + return new AccountApiKeys(key1, key2, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The access key of the workspace app insights. /// @@ -2251,8 +2480,8 @@ public static MachineLearningFqdnEndpointDetail MachineLearningFqdnEndpointDetai /// The systemData. /// /// Outbound Rule for the managed network of a machine learning workspace. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . /// /// A new instance for mocking. public static MachineLearningOutboundRuleBasicData MachineLearningOutboundRuleBasicData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningOutboundRule properties = null) @@ -2510,10 +2739,31 @@ public static MachineLearningComputeInstanceSshSettings MachineLearningComputeIn /// Specifies the current operating system image version this compute instance is running on. /// Specifies the latest available operating system image version. /// Specifies whether this compute instance is running on the latest operating system image. + /// Metadata about the os patching. /// A new instance for mocking. - public static ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = null) + public static ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = null, OSPatchingStatus osPatchingStatus = null) { - return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, serializedAdditionalRawData: null); + return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, osPatchingStatus, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The os patching status. + /// Time of the latest os patching. + /// Specifies whether this compute instance is pending for reboot to finish os patching. + /// Time of scheduled reboot. + /// Collection of errors encountered when doing os patching. + /// A new instance for mocking. + public static OSPatchingStatus OSPatchingStatus(PatchStatus? patchStatus = null, string latestPatchTime = null, bool? rebootPending = null, string scheduledRebootTime = null, IEnumerable osPatchingErrors = null) + { + osPatchingErrors ??= new List(); + + return new OSPatchingStatus( + patchStatus, + latestPatchTime, + rebootPending, + scheduledRebootTime, + osPatchingErrors?.ToList(), + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2565,7 +2815,7 @@ public static MachineLearningComputeInstanceLastOperation MachineLearningCompute /// Required if triggerType is Cron. /// [Deprecated] Not used any more. /// A new instance for mocking. - public static MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, MachineLearningComputeProvisioningStatus? provisioningStatus = null, MachineLearningScheduleStatus? status = null, MachineLearningComputePowerAction? action = null, MachineLearningTriggerType? triggerType = null, ComputeStartStopRecurrenceSchedule recurrenceSchedule = null, ComputeStartStopCronSchedule cronSchedule = null, MachineLearningScheduleBase schedule = null) + public static MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, MachineLearningComputeProvisioningStatus? provisioningStatus = null, MachineLearningScheduleStatus? status = null, MachineLearningComputePowerAction? action = null, ComputeTriggerType? triggerType = null, ComputeStartStopRecurrenceSchedule recurrenceSchedule = null, ComputeStartStopCronSchedule cronSchedule = null, MachineLearningScheduleBase schedule = null) { return new MachineLearningComputeStartStopSchedule( id, @@ -2621,32 +2871,6 @@ public static MachineLearningComputeInstanceDataDisk MachineLearningComputeInsta return new MachineLearningComputeInstanceDataDisk(caching, diskSizeGB, lun, storageAccountType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Source of the ComputeInstance data mount. - /// Data source type. - /// name of the ComputeInstance data mount. - /// Mount Action. - /// who this data mount created by. - /// Path of this data mount. - /// Mount state. - /// The time when the disk mounted. - /// Error of this data mount. - /// A new instance for mocking. - public static MachineLearningComputeInstanceDataMount MachineLearningComputeInstanceDataMount(string source = null, MachineLearningSourceType? sourceType = null, string mountName = null, MachineLearningMountAction? mountAction = null, string createdBy = null, string mountPath = null, MachineLearningMountState? mountState = null, DateTimeOffset? mountedOn = null, string error = null) - { - return new MachineLearningComputeInstanceDataMount( - source, - sourceType, - mountName, - mountAction, - createdBy, - mountPath, - mountState, - mountedOn, - error, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Location for the underlying compute. /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. @@ -2904,7 +3128,6 @@ public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksC /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -2920,7 +3143,7 @@ public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksC /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , and . /// - /// Queue settings for the job. + /// Queue settings for the job. /// Compute Resource configuration for the job. /// /// [Required] This represents scenario which can be one of Tables/NLP/Image @@ -2928,11 +3151,10 @@ public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksC /// The available derived classes include , , , , , , , , and . /// /// A new instance for mocking. - public static AutoMLJob AutoMLJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary outputs = null, JobQueueSettings queueSettings = null, MachineLearningJobResourceConfiguration resources = null, AutoMLVertical taskDetails = null) + public static AutoMLJob AutoMLJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary outputs = null, JobTier? queueJobTier = null, MachineLearningJobResourceConfiguration resources = null, AutoMLVertical taskDetails = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); environmentVariables ??= new Dictionary(); outputs ??= new Dictionary(); @@ -2950,13 +3172,12 @@ public static AutoMLJob AutoMLJob(string description = null, IDictionary /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Storage account name. /// Storage account container name. @@ -2980,7 +3200,7 @@ public static AutoMLJob AutoMLJob(string description = null, IDictionary Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string accountName = null, string containerName = null, string endpoint = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string containerName = null, string endpoint = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -2992,7 +3212,6 @@ public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastor serializedAdditionalRawData: null, credentials, DatastoreType.AzureBlob, - intellectualProperty, isDefault, accountName, containerName, @@ -3010,16 +3229,15 @@ public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastor /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Indicates which identity to use to authenticate service data access to customer's storage. /// [Required] Azure Data Lake store name. /// Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string storeName = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string storeName = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3031,7 +3249,6 @@ public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureData serializedAdditionalRawData: null, credentials, DatastoreType.AzureDataLakeGen1, - intellectualProperty, isDefault, serviceDataAccessAuthIdentity, storeName, @@ -3046,9 +3263,8 @@ public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureData /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -3058,7 +3274,7 @@ public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureData /// Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3070,7 +3286,6 @@ public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureData serializedAdditionalRawData: null, credentials, DatastoreType.AzureDataLakeGen2, - intellectualProperty, isDefault, accountName, endpoint, @@ -3088,9 +3303,8 @@ public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureData /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -3100,7 +3314,7 @@ public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureData /// Azure Resource Group name. /// Azure Subscription Id. /// A new instance for mocking. - public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3112,7 +3326,6 @@ public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastor serializedAdditionalRawData: null, credentials, DatastoreType.AzureFile, - intellectualProperty, isDefault, accountName, endpoint, @@ -3123,27 +3336,6 @@ public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastor subscriptionId); } - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - /// A new instance for mocking. - public static CocoExportSummary CocoExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string labelingJobId = null, DateTimeOffset? startOn = null, string containerName = null, string snapshotPath = null) - { - return new CocoExportSummary( - endOn, - exportedRowCount, - ExportFormatType.Coco, - labelingJobId, - startOn, - serializedAdditionalRawData: null, - containerName, - snapshotPath); - } - /// Initializes a new instance of . /// The asset description text. /// The asset property dictionary. @@ -3160,19 +3352,17 @@ public static CocoExportSummary CocoExportSummary(DateTimeOffset? endOn = null, /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// ARM resource ID of the code asset. /// [Required] The command to execute on startup of the job. eg. "python train.py". /// - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// [Required] The ARM resource ID of the Environment specification for the job. /// Environment variables included in the job. @@ -3188,14 +3378,13 @@ public static CocoExportSummary CocoExportSummary(DateTimeOffset? endOn = null, /// The available derived classes include , , , , and . /// /// Input parameters. - /// Queue settings for the job. + /// Queue settings for the job. /// Compute Resource configuration for the job. /// A new instance for mocking. - public static MachineLearningCommandJob MachineLearningCommandJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningFlowAutoLoggerState? mlflowAutologger = null, ResourceIdentifier codeId = null, string command = null, MachineLearningDistributionConfiguration distribution = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IDictionary inputs = null, MachineLearningCommandJobLimits limits = null, IDictionary outputs = null, BinaryData parameters = null, JobQueueSettings queueSettings = null, MachineLearningJobResourceConfiguration resources = null) + public static MachineLearningCommandJob MachineLearningCommandJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, ResourceIdentifier codeId = null, string command = null, MachineLearningDistributionConfiguration distribution = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IDictionary inputs = null, MachineLearningCommandJobLimits limits = null, IDictionary outputs = null, BinaryData parameters = null, JobTier? queueJobTier = null, MachineLearningJobResourceConfiguration resources = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); environmentVariables ??= new Dictionary(); inputs ??= new Dictionary(); @@ -3214,10 +3403,8 @@ public static MachineLearningCommandJob MachineLearningCommandJob(string descrip isArchived, JobType.Command, notificationSetting, - secretsConfiguration, services, status, - mlflowAutologger.HasValue ? new AutologgerSettings(mlflowAutologger.Value, serializedAdditionalRawData: null) : null, codeId, command, distribution, @@ -3227,88 +3414,86 @@ public static MachineLearningCommandJob MachineLearningCommandJob(string descrip limits, outputs, parameters, - queueSettings, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, resources); } - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - /// A new instance for mocking. - public static CsvExportSummary CsvExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string labelingJobId = null, DateTimeOffset? startOn = null, string containerName = null, string snapshotPath = null) + /// Initializes a new instance of . + /// DockerCredential user password. + /// DockerCredential user name. + /// A new instance for mocking. + public static DockerCredential DockerCredential(string password = null, string userName = null) { - return new CsvExportSummary( - endOn, - exportedRowCount, - ExportFormatType.CSV, - labelingJobId, - startOn, - serializedAdditionalRawData: null, - containerName, - snapshotPath); + return new DockerCredential(DataReferenceCredentialType.DockerCredentials, serializedAdditionalRawData: null, password, userName); } - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// The unique name of the labeled data asset. - /// A new instance for mocking. - public static DatasetExportSummary DatasetExportSummary(DateTimeOffset? endOn = null, long? exportedRowCount = null, string labelingJobId = null, DateTimeOffset? startOn = null, string labeledAssetName = null) - { - return new DatasetExportSummary( - endOn, - exportedRowCount, - ExportFormatType.Dataset, - labelingJobId, - startOn, - serializedAdditionalRawData: null, - labeledAssetName); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The asset description text. /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. - /// - /// [Required] Account credentials. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . /// - /// Intellectual Property details. - /// Readonly property to indicate if datastore is the workspace default datastore. - /// The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. - /// [Required] IP Address or DNS HostName. - /// Protocol used to communicate with the storage account (Https/Http). - /// A new instance for mocking. - public static HdfsDatastore HdfsDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, string hdfsServerCertificate = null, string nameNodeAddress = null, string protocol = null) + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Instance types and other resources for the job. + /// Queue settings for the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// A new instance for mocking. + public static FineTuningJob FineTuningJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, FineTuningVertical fineTuningDetails = null, IEnumerable resourcesInstanceTypes = null, JobTier? queueJobTier = null, IDictionary outputs = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); + services ??= new Dictionary(); + resourcesInstanceTypes ??= new List(); + outputs ??= new Dictionary(); - return new HdfsDatastore( + return new FineTuningJob( description, properties, tags, serializedAdditionalRawData: null, - credentials, - DatastoreType.Hdfs, - intellectualProperty, - isDefault, - hdfsServerCertificate, - nameNodeAddress, - protocol); + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.FineTuning, + notificationSetting, + services, + status, + fineTuningDetails, + resourcesInstanceTypes != null ? new JobResources(resourcesInstanceTypes?.ToList(), serializedAdditionalRawData: null) : null, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + outputs); } /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// If true, enables Application Insights logging. @@ -3358,10 +3543,29 @@ public static MachineLearningKubernetesOnlineDeployment MachineLearningKubernete containerResourceRequirements); } + /// Initializes a new instance of . + /// ManagedIdentityCredential identity type. + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// A new instance for mocking. + public static ManagedIdentityCredential ManagedIdentityCredential(string managedIdentityType = null, string userManagedIdentityClientId = null, string userManagedIdentityPrincipalId = null, string userManagedIdentityResourceId = null, string userManagedIdentityTenantId = null) + { + return new ManagedIdentityCredential( + DataReferenceCredentialType.ManagedIdentity, + serializedAdditionalRawData: null, + managedIdentityType, + userManagedIdentityClientId, + userManagedIdentityPrincipalId, + userManagedIdentityResourceId, + userManagedIdentityTenantId); + } + /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// If true, enables Application Insights logging. @@ -3416,9 +3620,8 @@ public static MachineLearningManagedOnlineDeployment MachineLearningManagedOnlin /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// /// [Required] OneLake artifact backing the datastore. @@ -3429,7 +3632,7 @@ public static MachineLearningManagedOnlineDeployment MachineLearningManagedOnlin /// [Required] OneLake workspace name. /// Indicates which identity to use to authenticate service data access to customer's storage. /// A new instance for mocking. - public static OneLakeDatastore OneLakeDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, IntellectualProperty intellectualProperty = null, bool? isDefault = null, OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null) + public static OneLakeDatastore OneLakeDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); @@ -3441,7 +3644,6 @@ public static OneLakeDatastore OneLakeDatastore(string description = null, IDict serializedAdditionalRawData: null, credentials, DatastoreType.OneLake, - intellectualProperty, isDefault, artifact, endpoint, @@ -3465,7 +3667,6 @@ public static OneLakeDatastore OneLakeDatastore(string description = null, IDict /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -3485,11 +3686,10 @@ public static OneLakeDatastore OneLakeDatastore(string description = null, IDict /// Pipeline settings, for things like ContinueRunOnStepFailure etc. /// ARM resource ID of source job. /// A new instance for mocking. - public static MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, IDictionary inputs = null, IDictionary jobs = null, IDictionary outputs = null, BinaryData settings = null, ResourceIdentifier sourceJobId = null) + public static MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, IDictionary inputs = null, IDictionary jobs = null, IDictionary outputs = null, BinaryData settings = null, ResourceIdentifier sourceJobId = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); inputs ??= new Dictionary(); jobs ??= new Dictionary(); @@ -3508,7 +3708,6 @@ public static MachineLearningPipelineJob MachineLearningPipelineJob(string descr isArchived, JobType.Pipeline, notificationSetting, - secretsConfiguration, services, status, inputs, @@ -3518,6 +3717,14 @@ public static MachineLearningPipelineJob MachineLearningPipelineJob(string descr sourceJobId); } + /// Initializes a new instance of . + /// Full SAS Uri, including the storage, container/blob path and SAS token. + /// A new instance for mocking. + public static SasCredential SasCredential(Uri sasUri = null) + { + return new SasCredential(DataReferenceCredentialType.Sas, serializedAdditionalRawData: null, sasUri); + } + /// Initializes a new instance of . /// Full SAS Uri, including the storage, container/blob path and SAS token. /// A new instance for mocking. @@ -3542,7 +3749,6 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -3550,7 +3756,7 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// Status of the job. /// Archive files used in the job. /// Arguments for the job. - /// [Required] ARM resource ID of the code asset. + /// [Required] arm-id of the code asset. /// Spark configured properties. /// /// [Required] The entry to execute on startup of the job. @@ -3558,6 +3764,7 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// The available derived classes include and . /// /// The ARM resource ID of the Environment specification for the job. + /// Environment variables included in the job. /// Files used in the job. /// /// Mapping of input data bindings used in the job. @@ -3571,17 +3778,17 @@ public static SasCredentialDto SasCredentialDto(Uri sasUri = null) /// The available derived classes include , , , , and . /// /// Python files used in the job. - /// Queue settings for the job. + /// Queue settings for the job. /// Compute Resource configuration for the job. /// A new instance for mocking. - public static SparkJob SparkJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, IEnumerable archives = null, string args = null, string codeId = null, IDictionary conf = null, SparkJobEntry entry = null, string environmentId = null, IEnumerable files = null, IDictionary inputs = null, IEnumerable jars = null, IDictionary outputs = null, IEnumerable pyFiles = null, JobQueueSettings queueSettings = null, SparkResourceConfiguration resources = null) + public static SparkJob SparkJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, IEnumerable archives = null, string args = null, ResourceIdentifier codeId = null, IDictionary conf = null, SparkJobEntry entry = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IEnumerable files = null, IDictionary inputs = null, IEnumerable jars = null, IDictionary outputs = null, IEnumerable pyFiles = null, JobTier? queueJobTier = null, SparkResourceConfiguration resources = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); archives ??= new List(); conf ??= new Dictionary(); + environmentVariables ??= new Dictionary(); files ??= new List(); inputs ??= new Dictionary(); jars ??= new List(); @@ -3601,7 +3808,6 @@ public static SparkJob SparkJob(string description = null, IDictionary /// Is the asset archived?. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -3658,7 +3864,7 @@ public static SparkJob SparkJob(string description = null, IDictionary is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , and . /// - /// Queue settings for the job. + /// Queue settings for the job. /// /// [Required] The hyperparameter sampling algorithm /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -3667,11 +3873,10 @@ public static SparkJob SparkJob(string description = null, IDictionary [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. /// [Required] Trial component definition. /// A new instance for mocking. - public static MachineLearningSweepJob MachineLearningSweepJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary secretsConfiguration = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningEarlyTerminationPolicy earlyTermination = null, IDictionary inputs = null, MachineLearningSweepJobLimits limits = null, MachineLearningObjective objective = null, IDictionary outputs = null, JobQueueSettings queueSettings = null, SamplingAlgorithm samplingAlgorithm = null, BinaryData searchSpace = null, MachineLearningTrialComponent trial = null) + public static MachineLearningSweepJob MachineLearningSweepJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningEarlyTerminationPolicy earlyTermination = null, IDictionary inputs = null, MachineLearningSweepJobLimits limits = null, MachineLearningObjective objective = null, IDictionary outputs = null, JobTier? queueJobTier = null, SamplingAlgorithm samplingAlgorithm = null, BinaryData searchSpace = null, MachineLearningTrialComponent trial = null) { properties ??= new Dictionary(); tags ??= new Dictionary(); - secretsConfiguration ??= new Dictionary(); services ??= new Dictionary(); inputs ??= new Dictionary(); outputs ??= new Dictionary(); @@ -3689,7 +3894,6 @@ public static MachineLearningSweepJob MachineLearningSweepJob(string description isArchived, JobType.Sweep, notificationSetting, - secretsConfiguration, services, status, earlyTermination, @@ -3697,7 +3901,7 @@ public static MachineLearningSweepJob MachineLearningSweepJob(string description limits, objective, outputs, - queueSettings, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, samplingAlgorithm, searchSpace, trial); @@ -3715,16 +3919,11 @@ public static MachineLearningSweepJob MachineLearningSweepJob(string description /// Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. /// A new instance for mocking. - public static TextClassificationMultilabel TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationMultilabelPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpFixedParameters fixedParameters = null, NlpVerticalLimitSettings limitSettings = null, IEnumerable searchSpace = null, NlpSweepSettings sweepSettings = null, MachineLearningTableJobInput validationData = null) + public static TextClassificationMultilabel TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationMultilabelPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpVerticalLimitSettings limitSettings = null, MachineLearningTableJobInput validationData = null) { - searchSpace ??= new List(); - return new TextClassificationMultilabel( logVerbosity, targetColumnName, @@ -3733,10 +3932,7 @@ public static TextClassificationMultilabel TextClassificationMultilabel(MachineL serializedAdditionalRawData: null, primaryMetric, featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, - fixedParameters, limitSettings, - searchSpace?.ToList(), - sweepSettings, validationData); } @@ -3752,16 +3948,11 @@ public static TextClassificationMultilabel TextClassificationMultilabel(MachineL /// Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. /// A new instance for mocking. - public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpFixedParameters fixedParameters = null, NlpVerticalLimitSettings limitSettings = null, IEnumerable searchSpace = null, NlpSweepSettings sweepSettings = null, MachineLearningTableJobInput validationData = null) + public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpVerticalLimitSettings limitSettings = null, MachineLearningTableJobInput validationData = null) { - searchSpace ??= new List(); - return new TextNer( logVerbosity, targetColumnName, @@ -3770,13 +3961,695 @@ public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, serializedAdditionalRawData: null, primaryMetric, featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, - fixedParameters, limitSettings, - searchSpace?.ToList(), - sweepSettings, validationData); } + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AadAuthTypeWorkspaceConnectionProperties AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AadAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.Aad, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AccessKeyAuthTypeWorkspaceConnectionProperties AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionAccessKey credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccessKeyAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.AccessKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Account key object for workspace connection credential. + /// A new instance for mocking. + public static AccountKeyAuthTypeWorkspaceConnectionProperties AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccountKeyAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.AccountKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new WorkspaceConnectionAccountKey(credentialsKey, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Api key object for workspace connection credential. + /// A new instance for mocking. + public static ApiKeyAuthWorkspaceConnectionProperties ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ApiKeyAuthWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.ApiKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new WorkspaceConnectionApiKey(credentialsKey, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static ContentSafetyEndpointDeploymentResourceProperties ContentSafetyEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new ContentSafetyEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.ContentSafety", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static ContentSafetyEndpointResourceProperties ContentSafetyEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new ContentSafetyEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureContentSafety, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Custom Keys credential object. + /// A new instance for mocking. + public static CustomKeysWorkspaceConnectionProperties CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, IDictionary credentialsKeys = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + credentialsKeys ??= new Dictionary(); + + return new CustomKeysWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.CustomKeys, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKeys != null ? new CustomKeys(credentialsKeys, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// + /// A new instance for mocking. + public static FqdnOutboundRule FqdnOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, string destination = null) + { + parentRuleNames ??= new List(); + + return new FqdnOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.Fqdn, + serializedAdditionalRawData: null, + destination); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningManagedIdentityAuthTypeWorkspaceConnection MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, MachineLearningWorkspaceConnectionManagedIdentity credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningManagedIdentityAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.ManagedIdentity, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Enum to determine endpoint compute type. + /// + /// A new instance for mocking. + public static ManagedOnlineEndpointDeploymentResourceProperties ManagedOnlineEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, MachineLearningEndpointComputeType? endpointComputeType = null, string model = null) + { + return new ManagedOnlineEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "managedOnlineEndpoint", + serializedAdditionalRawData: null, + endpointComputeType, + model); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Enum to determine endpoint authentication mode. + /// + /// + /// Dictionary of <integer>. + /// + /// Dictionary of <integer>. + /// A new instance for mocking. + public static ManagedOnlineEndpointResourceProperties ManagedOnlineEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null, MachineLearningEndpointAuthMode? authMode = null, string compute = null, string description = null, IDictionary mirrorTraffic = null, Uri scoringUri = null, IDictionary traffic = null) + { + deployments ??= new List(); + mirrorTraffic ??= new Dictionary(); + traffic ??= new Dictionary(); + + return new ManagedOnlineEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.ManagedOnlineEndpoint, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null, + authMode, + compute, + description, + mirrorTraffic, + scoringUri, + traffic); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningNoneAuthTypeWorkspaceConnection MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningNoneAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.None, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + /// A new instance for mocking. + public static OAuth2AuthTypeWorkspaceConnectionProperties OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionOAuth2 credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new OAuth2AuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.OAuth2, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static OpenAIEndpointDeploymentResourceProperties OpenAIEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new OpenAIEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.OpenAI", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static OpenAIEndpointResourceProperties OpenAIEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new OpenAIEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureOpenAI, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningPatAuthTypeWorkspaceConnection MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsPat = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningPatAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.Pat, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsPat != null ? new WorkspaceConnectionPersonalAccessToken(credentialsPat, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. + /// + /// A new instance for mocking. + public static PrivateEndpointOutboundRule PrivateEndpointOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, PrivateEndpointDestination destination = null, IEnumerable fqdns = null) + { + parentRuleNames ??= new List(); + fqdns ??= new List(); + + return new PrivateEndpointOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.PrivateEndpoint, + serializedAdditionalRawData: null, + destination, + fqdns?.ToList()); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsSas = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningSasAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.Sas, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsSas != null ? new WorkspaceConnectionSharedAccessSignature(credentialsSas, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// + /// + /// + /// State of the Serverless Endpoint. + /// + /// + /// Anything. + /// + /// + /// A new instance for mocking. + public static ServerlessEndpointResourceProperties ServerlessEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null, ServerlessInferenceEndpointAuthMode? authMode = null, ServerlessEndpointCapacityReservation capacityReservation = null, ContentSafetyStatus? contentSafetyStatus = null, ServerlessEndpointState? endpointState = null, ServerlessEndpointInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, BinaryData metadata = null, string modelId = null, ServerlessOffer offer = null) + { + deployments ??= new List(); + + return new ServerlessEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.ServerlessEndpoint, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null, + authMode, + capacityReservation, + contentSafetyStatus.HasValue ? new ServerlessEndpointContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + metadata, + modelId != null ? new ServerlessEndpointModelSettings(modelId, serializedAdditionalRawData: null) : null, + offer); + } + + /// Initializes a new instance of . + /// Dictionary of <string>. + /// + /// A new instance for mocking. + public static ServerlessEndpointInferenceEndpoint ServerlessEndpointInferenceEndpoint(IReadOnlyDictionary headers = null, Uri uri = null) + { + headers ??= new Dictionary(); + + return new ServerlessEndpointInferenceEndpoint(headers, uri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ServicePrincipalAuthTypeWorkspaceConnectionProperties ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionServicePrincipal credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ServicePrincipalAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.ServicePrincipal, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + /// Initializes a new instance of . /// The action enum for networking rule. /// Optional, if provided, the ServiceTag property will be ignored. @@ -3796,5 +4669,113 @@ public static ServiceTagDestination ServiceTagDestination(NetworkingRuleAction? serviceTag, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + /// A new instance for mocking. + public static ServiceTagOutboundRule ServiceTagOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, ServiceTagDestination destination = null) + { + parentRuleNames ??= new List(); + + return new ServiceTagOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.ServiceTag, + serializedAdditionalRawData: null, + destination); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static SpeechEndpointDeploymentResourceProperties SpeechEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new SpeechEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.Speech", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static SpeechEndpointResourceProperties SpeechEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new SpeechEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureSpeech, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, MachineLearningWorkspaceConnectionUsernamePassword credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new MachineLearningUsernamePasswordAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.UsernamePassword, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..ad099275825de --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement, options); + } + + internal static EndpointDeploymentResourcePropertiesBasicResourceData DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EndpointDeploymentResourceProperties.DeserializeEndpointDeploymentResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentResourcePropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..1860ef8e1a60a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the EndpointDeploymentResourcePropertiesBasicResource data model. + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// is null. + public EndpointDeploymentResourcePropertiesBasicResourceData(EndpointDeploymentResourceProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourcePropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointDeploymentResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointDeploymentResourcePropertiesBasicResourceData() + { + } + + /// + /// Gets or sets the properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public EndpointDeploymentResourceProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs new file mode 100644 index 0000000000000..5b6d657920015 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointResourcePropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs new file mode 100644 index 0000000000000..8fb6c0371ce27 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs @@ -0,0 +1,623 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing an EndpointResourcePropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEndpointResourcePropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetEndpointResourcePropertiesBasicResource method. + /// + public partial class EndpointResourcePropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics; + private readonly EndpointRestOperations _endpointResourcePropertiesBasicResourceEndpointRestClient; + private readonly EndpointResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints"; + + /// Initializes a new instance of the class for mocking. + protected EndpointResourcePropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EndpointResourcePropertiesBasicResource(ArmClient client, EndpointResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal EndpointResourcePropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string endpointResourcePropertiesBasicResourceEndpointApiVersion); + _endpointResourcePropertiesBasicResourceEndpointRestClient = new EndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointResourcePropertiesBasicResourceEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of WorkspaceEndpointDeploymentResources in the EndpointResourcePropertiesBasicResource. + /// An object representing collection of WorkspaceEndpointDeploymentResources and their operations over a WorkspaceEndpointDeploymentResource. + public virtual WorkspaceEndpointDeploymentCollection GetWorkspaceEndpointDeployments() + { + return GetCachedClient(client => new WorkspaceEndpointDeploymentCollection(client, Id)); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceEndpointDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceEndpointDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceEndpointDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetWorkspaceEndpointDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of WorkspaceEndpointRaiPolicyResources in the EndpointResourcePropertiesBasicResource. + /// An object representing collection of WorkspaceEndpointRaiPolicyResources and their operations over a WorkspaceEndpointRaiPolicyResource. + public virtual WorkspaceEndpointRaiPolicyCollection GetWorkspaceEndpointRaiPolicies() + { + return GetCachedClient(client => new WorkspaceEndpointRaiPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceEndpointRaiPolicyAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceEndpointRaiPolicies().GetAsync(raiPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceEndpointRaiPolicy(string raiPolicyName, CancellationToken cancellationToken = default) + { + return GetWorkspaceEndpointRaiPolicies().Get(raiPolicyName, cancellationToken); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Endpoint resource object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Endpoint resource object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List keys for the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys + /// + /// + /// Operation Id + /// Endpoint_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.GetKeys"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List keys for the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys + /// + /// + /// Operation Id + /// Endpoint_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeys(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.GetKeys"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get available models under the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models + /// + /// + /// Operation Id + /// Endpoint_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResource.GetModels", "value", "nextLink", cancellationToken); + } + + /// + /// Get available models under the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models + /// + /// + /// Operation Id + /// Endpoint_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModels(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResource.GetModels", "value", "nextLink", cancellationToken); + } + + /// + /// Regenerate account keys + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey + /// + /// + /// Operation Id + /// Endpoint_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeysAsync(RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.RegenerateKeys"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate account keys + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey + /// + /// + /// Operation Id + /// Endpoint_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual Response RegenerateKeys(RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.RegenerateKeys"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..246888d98fcad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEndpointResourcePropertiesBasicResources method from an instance of . + /// + public partial class EndpointResourcePropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics; + private readonly EndpointRestOperations _endpointResourcePropertiesBasicResourceEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected EndpointResourcePropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal EndpointResourcePropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", EndpointResourcePropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EndpointResourcePropertiesBasicResource.ResourceType, out string endpointResourcePropertiesBasicResourceEndpointApiVersion); + _endpointResourcePropertiesBasicResourceEndpointRestClient = new EndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointResourcePropertiesBasicResourceEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List All the endpoints under this workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EndpointResourcePropertiesBasicResource(Client, EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(e)), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List All the endpoints under this workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EndpointResourcePropertiesBasicResource(Client, EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(e)), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..37c675081d5d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointResourcePropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement, options); + } + + internal static EndpointResourcePropertiesBasicResourceData DeserializeEndpointResourcePropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EndpointResourceProperties.DeserializeEndpointResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointResourcePropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..1a2f0a42b734f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the EndpointResourcePropertiesBasicResource data model. + public partial class EndpointResourcePropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// is null. + public EndpointResourcePropertiesBasicResourceData(EndpointResourceProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Keeps track of any properties unknown to the library. + internal EndpointResourcePropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointResourcePropertiesBasicResourceData() + { + } + + /// + /// Gets or sets the properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public EndpointResourceProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs index d076491ca587d..b3282d0cd39be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs @@ -356,6 +356,25 @@ public static MachineLearningEnvironmentVersionResource GetMachineLearningEnviro return GetMockableMachineLearningArmClient(client).GetMachineLearningEnvironmentVersionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMarketplaceSubscriptionResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -603,25 +622,6 @@ public static MachineLearningJobResource GetMachineLearningJobResource(this ArmC return GetMockableMachineLearningArmClient(client).GetMachineLearningJobResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableMachineLearningArmClient(client).GetMachineLearningLabelingJobResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -679,6 +679,25 @@ public static MachineLearningScheduleResource GetMachineLearningScheduleResource return GetMockableMachineLearningArmClient(client).GetMachineLearningScheduleResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ServerlessEndpointResource GetServerlessEndpointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetServerlessEndpointResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -736,6 +755,139 @@ public static MachineLearningWorkspaceConnectionResource GetMachineLearningWorks return GetMockableMachineLearningArmClient(client).GetMachineLearningWorkspaceConnectionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceConnectionDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceEndpointDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetRaiBlocklistPropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetRaiBlocklistItemPropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceConnectionRaiPolicyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceEndpointRaiPolicyResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetEndpointResourcePropertiesBasicResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -804,7 +956,7 @@ public static MachineLearningRegistryCollection GetMachineLearningRegistries(thi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -842,7 +994,7 @@ public static async Task> GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -897,7 +1049,7 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -910,7 +1062,7 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// /// /// The instance the method will execute against. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -935,7 +1087,7 @@ public static async Task> GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -948,7 +1100,7 @@ public static async Task> GetMachineL /// /// /// The instance the method will execute against. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -973,7 +1125,7 @@ public static Response GetMachineLearningWorks /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1006,7 +1158,7 @@ public static AsyncPageable GetMachineLearningUsagesAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1039,7 +1191,7 @@ public static Pageable GetMachineLearningUsages(this Subsc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1072,7 +1224,7 @@ public static AsyncPageable GetMachineLearningVmSizesAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1105,7 +1257,7 @@ public static Pageable GetMachineLearningVmSizes(this Sub /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1139,7 +1291,7 @@ public static AsyncPageable UpdateMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1173,7 +1325,7 @@ public static Pageable UpdateMachineLearnin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1206,7 +1358,7 @@ public static AsyncPageable GetMachineLearningQuot /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1239,7 +1391,7 @@ public static Pageable GetMachineLearningQuotas(th /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1275,7 +1427,7 @@ public static AsyncPageable GetMachineLearningR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1311,7 +1463,7 @@ public static Pageable GetMachineLearningRegist /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1320,20 +1472,21 @@ public static Pageable GetMachineLearningRegist /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetMachineLearningWorkspacesAsync(this SubscriptionResource subscriptionResource, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public static AsyncPageable GetMachineLearningWorkspacesAsync(this SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspacesAsync(skip, kind, cancellationToken); + return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspacesAsync(kind, skip, aiCapabilities, cancellationToken); } /// @@ -1349,7 +1502,7 @@ public static AsyncPageable GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1358,20 +1511,21 @@ public static AsyncPageable GetMachineLearning /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetMachineLearningWorkspaces(this SubscriptionResource subscriptionResource, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public static Pageable GetMachineLearningWorkspaces(this SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspaces(skip, kind, cancellationToken); + return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspaces(kind, skip, aiCapabilities, cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs index 114937ffbe80a..71fe5700b4906 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs @@ -238,6 +238,18 @@ public virtual MachineLearningEnvironmentVersionResource GetMachineLearningEnvir return new MachineLearningEnvironmentVersionResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(ResourceIdentifier id) + { + MarketplaceSubscriptionResource.ValidateResourceId(id); + return new MarketplaceSubscriptionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -394,18 +406,6 @@ public virtual MachineLearningJobResource GetMachineLearningJobResource(Resource return new MachineLearningJobResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(ResourceIdentifier id) - { - MachineLearningLabelingJobResource.ValidateResourceId(id); - return new MachineLearningLabelingJobResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -442,6 +442,18 @@ public virtual MachineLearningScheduleResource GetMachineLearningScheduleResourc return new MachineLearningScheduleResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServerlessEndpointResource GetServerlessEndpointResource(ResourceIdentifier id) + { + ServerlessEndpointResource.ValidateResourceId(id); + return new ServerlessEndpointResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -478,6 +490,90 @@ public virtual MachineLearningWorkspaceConnectionResource GetMachineLearningWork return new MachineLearningWorkspaceConnectionResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(ResourceIdentifier id) + { + WorkspaceConnectionDeploymentResource.ValidateResourceId(id); + return new WorkspaceConnectionDeploymentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(ResourceIdentifier id) + { + WorkspaceEndpointDeploymentResource.ValidateResourceId(id); + return new WorkspaceEndpointDeploymentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(ResourceIdentifier id) + { + RaiBlocklistPropertiesBasicResource.ValidateResourceId(id); + return new RaiBlocklistPropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(ResourceIdentifier id) + { + RaiBlocklistItemPropertiesBasicResource.ValidateResourceId(id); + return new RaiBlocklistItemPropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(ResourceIdentifier id) + { + WorkspaceConnectionRaiPolicyResource.ValidateResourceId(id); + return new WorkspaceConnectionRaiPolicyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(ResourceIdentifier id) + { + WorkspaceEndpointRaiPolicyResource.ValidateResourceId(id); + return new WorkspaceEndpointRaiPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(ResourceIdentifier id) + { + EndpointResourcePropertiesBasicResource.ValidateResourceId(id); + return new EndpointResourcePropertiesBasicResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs index a2098b03a7d79..4a363a48d0d67 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual MachineLearningRegistryCollection GetMachineLearningRegistries() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -122,7 +122,7 @@ public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -130,7 +130,7 @@ public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -153,7 +153,7 @@ public virtual async Task> GetMachine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -161,7 +161,7 @@ public virtual async Task> GetMachine /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs index ad959c840d956..99b0ad2b86bab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs @@ -70,7 +70,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -97,7 +97,7 @@ public virtual AsyncPageable GetMachineLearningUsagesAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -124,7 +124,7 @@ public virtual Pageable GetMachineLearningUsages(AzureLoca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -150,7 +150,7 @@ public virtual AsyncPageable GetMachineLearningVmSizesAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -176,7 +176,7 @@ public virtual Pageable GetMachineLearningVmSizes(AzureLo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -206,7 +206,7 @@ public virtual AsyncPageable UpdateMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -236,7 +236,7 @@ public virtual Pageable UpdateMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -263,7 +263,7 @@ public virtual AsyncPageable GetMachineLearningQuo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -290,7 +290,7 @@ public virtual Pageable GetMachineLearningQuotas(A /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -320,7 +320,7 @@ public virtual AsyncPageable GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -350,7 +350,7 @@ public virtual Pageable GetMachineLearningRegis /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -358,14 +358,15 @@ public virtual Pageable GetMachineLearningRegis /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); } @@ -382,7 +383,7 @@ public virtual AsyncPageable GetMachineLearnin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -390,14 +391,15 @@ public virtual AsyncPageable GetMachineLearnin /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMachineLearningWorkspaces(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual Pageable GetMachineLearningWorkspaces(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs new file mode 100644 index 0000000000000..4f554006d1f07 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class EndpointResourcePropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EndpointResourcePropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + EndpointResourcePropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return new EndpointResourcePropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return new EndpointResourcePropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs deleted file mode 100644 index d72f96b8e6b8b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ExportSummaryOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class ExportSummaryOperationSource : IOperationSource - { - ExportSummary IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ExportSummary.DeserializeExportSummary(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ExportSummary.DeserializeExportSummary(document.RootElement); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs new file mode 100644 index 0000000000000..b89089eedcf4c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/FeaturesetVersionBackfillResponseOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class FeaturesetVersionBackfillResponseOperationSource : IOperationSource + { + FeaturesetVersionBackfillResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return FeaturesetVersionBackfillResponse.DeserializeFeaturesetVersionBackfillResponse(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return FeaturesetVersionBackfillResponse.DeserializeFeaturesetVersionBackfillResponse(document.RootElement); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs new file mode 100644 index 0000000000000..431b3ba29f5c1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class IListOperationSource : IOperationSource> + { + IList IOperationSource>.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item)); + } + return array; + } + + async ValueTask> IOperationSource>.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item)); + } + return array; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs new file mode 100644 index 0000000000000..bec67d9a74cbc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningEndpointAuthKeysOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class MachineLearningEndpointAuthKeysOperationSource : IOperationSource + { + MachineLearningEndpointAuthKeys IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs deleted file mode 100644 index c5389978789fd..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningFeatureSetJobOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class MachineLearningFeatureSetJobOperationSource : IOperationSource - { - MachineLearningFeatureSetJob IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(document.RootElement); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs deleted file mode 100644 index 0892ac9baf40f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MachineLearningLabelingJobOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class MachineLearningLabelingJobOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal MachineLearningLabelingJobOperationSource(ArmClient client) - { - _client = client; - } - - MachineLearningLabelingJobResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); - return new MachineLearningLabelingJobResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); - return new MachineLearningLabelingJobResource(_client, data); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs new file mode 100644 index 0000000000000..2d4b53b0ae783 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/MarketplaceSubscriptionOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class MarketplaceSubscriptionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MarketplaceSubscriptionOperationSource(ArmClient client) + { + _client = client; + } + + MarketplaceSubscriptionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return new MarketplaceSubscriptionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return new MarketplaceSubscriptionResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs deleted file mode 100644 index be8461b45ac6c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ModelPackageResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - internal class ModelPackageResultOperationSource : IOperationSource - { - ModelPackageResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ModelPackageResult.DeserializeModelPackageResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ModelPackageResult.DeserializeModelPackageResult(document.RootElement); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs new file mode 100644 index 0000000000000..426c54311b8af --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class RaiBlocklistItemPropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RaiBlocklistItemPropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + RaiBlocklistItemPropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistItemPropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistItemPropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs new file mode 100644 index 0000000000000..793b43a3cc613 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class RaiBlocklistPropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RaiBlocklistPropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + RaiBlocklistPropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistPropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistPropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs new file mode 100644 index 0000000000000..d6c4425cdf401 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/ServerlessEndpointOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class ServerlessEndpointOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ServerlessEndpointOperationSource(ArmClient client) + { + _client = client; + } + + ServerlessEndpointResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); + return new ServerlessEndpointResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); + return new ServerlessEndpointResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs new file mode 100644 index 0000000000000..c5b5ab80b58b8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceConnectionDeploymentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceConnectionDeploymentOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceConnectionDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionDeploymentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionDeploymentResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs new file mode 100644 index 0000000000000..73fa1799c27a0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceConnectionRaiPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceConnectionRaiPolicyOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceConnectionRaiPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionRaiPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionRaiPolicyResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs new file mode 100644 index 0000000000000..e6ea7c9ca04c0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceEndpointDeploymentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceEndpointDeploymentOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceEndpointDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointDeploymentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointDeploymentResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs new file mode 100644 index 0000000000000..5a67333ed125c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceEndpointRaiPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceEndpointRaiPolicyOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceEndpointRaiPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointRaiPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointRaiPolicyResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs index 8c90d386bc8e0..6b40365c0ec9c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string componentName, Canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string componentName, CancellationToken can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs index 7e1a17779aa74..f71d80ff38bb6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearninRegistryComponentVersionCollection GetMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs index e4ee308edbc8a..40aa367365569 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Crea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -263,13 +263,12 @@ public virtual Response Get(stri /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearninRegistryComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearninRegistryComponentVersionRegistryComponentVersionsClientDiagnostics, Pipeline, "MachineLearninRegistryComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -286,7 +285,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -297,13 +296,12 @@ public virtual AsyncPageable Get /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearninRegistryComponentVersionRegistryComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearninRegistryComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearninRegistryComponentVersionRegistryComponentVersionsClientDiagnostics, Pipeline, "MachineLearninRegistryComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -320,7 +318,7 @@ public virtual Pageable GetAll(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -363,7 +361,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -406,7 +404,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -451,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs index ccc343d5d7124..0e3bda58db399 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs index 40995fa39d1b1..5de565eef67f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string deplo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(string or /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs index a94f8aff04d52..2c55ed63da6e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -422,7 +422,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -484,7 +484,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -541,7 +541,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -598,7 +598,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -658,7 +658,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs index 350ba06f01e1e..e37da0546f354 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string endpoin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(i /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(int? count /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs index ad6d26f61b99f..02f75053591b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs @@ -110,7 +110,7 @@ public virtual MachineLearningBatchDeploymentCollection GetMachineLearningBatchD /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetM /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -566,7 +566,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -628,7 +628,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -685,7 +685,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -742,7 +742,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -802,7 +802,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs index c8089986cd123..4e782372c840d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string name, C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(string skip /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs index 4fe2f6cca6cc8..b5b35c7508b37 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningCodeVersionCollection GetMachineLearningCodeVersio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetMachi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearningCo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs index b20711932e265..4ea9de896e868 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -326,7 +326,7 @@ public virtual Pageable GetAll(string orderB /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -369,7 +369,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -412,7 +412,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -457,7 +457,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs index b1943562d4b74..c26a3067234c4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -354,6 +354,98 @@ public virtual ArmOperation Update(WaitUntil } } + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// CodeVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningCodeVersionCodeVersionsClientDiagnostics.CreateScope("MachineLearningCodeVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningCodeVersionCodeVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningCodeVersionCodeVersionsClientDiagnostics, Pipeline, _machineLearningCodeVersionCodeVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// CodeVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningCodeVersionCodeVersionsClientDiagnostics.CreateScope("MachineLearningCodeVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningCodeVersionCodeVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningCodeVersionCodeVersionsClientDiagnostics, Pipeline, _machineLearningCodeVersionCodeVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Generate a storage location and credential for the client to upload a code asset to. /// @@ -367,7 +459,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +501,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs index 5ff1450f251b9..5db3f9a41f8a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string na /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs index 2e99ce4265737..e10f2fd500024 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningComponentVersionCollection GetMachineLearningCompo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs index 717d39ccd3670..f1173ff82b43c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -244,76 +244,6 @@ public virtual Response Get(string vers } } - /// - /// List component versions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions - /// - /// - /// Operation Id - /// ComponentVersions_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Ordering of list. - /// Maximum number of records to return. - /// Continuation token for pagination. - /// View type for including/excluding (for example) archived entities. - /// Component stage. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, "MachineLearningComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List component versions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions - /// - /// - /// Operation Id - /// ComponentVersions_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Ordering of list. - /// Maximum number of records to return. - /// Continuation token for pagination. - /// View type for including/excluding (for example) archived entities. - /// Component stage. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningComponentVersionComponentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningComponentVersionResource(Client, MachineLearningComponentVersionData.DeserializeMachineLearningComponentVersionData(e)), _machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, "MachineLearningComponentVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - /// /// Checks to see if the resource exists in azure. /// @@ -327,7 +257,7 @@ public virtual Pageable GetAll(string o /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -370,7 +300,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -413,7 +343,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -458,7 +388,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs index e3d77cb42909c..c8a74caf3fa5e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +319,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -352,5 +353,97 @@ public virtual ArmOperation Update(Wait throw; } } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// ComponentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningComponentVersionComponentVersionsClientDiagnostics.CreateScope("MachineLearningComponentVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningComponentVersionComponentVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, _machineLearningComponentVersionComponentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// ComponentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningComponentVersionComponentVersionsClientDiagnostics.CreateScope("MachineLearningComponentVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningComponentVersionComponentVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningComponentVersionComponentVersionsClientDiagnostics, Pipeline, _machineLearningComponentVersionComponentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs index 6be0a15c0e532..4139dcaf29063 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string computeName, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string skip = nul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string computeName, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string computeName, CancellationToken cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs index 30b54713e54b7..6599b766d73c8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Machine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, MachineLearningUnderlyin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task UpdateCustomServicesAsync(IEnumerable /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -446,7 +446,7 @@ public virtual Response UpdateCustomServices(IEnumerable customSe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -476,7 +476,7 @@ public virtual AsyncPageable GetNodesAsync(Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual Pageable GetNodes(CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -544,7 +544,7 @@ public virtual async Task> GetKeysAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -569,6 +569,90 @@ public virtual Response GetKeys(CancellationToken } } + /// + /// Update Data Mounts of a Machine Learning compute. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts + /// + /// + /// Operation Id + /// Compute_UpdateDataMounts + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual async Task UpdateDataMountsAsync(IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateDataMounts"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.UpdateDataMountsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataMounts, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Data Mounts of a Machine Learning compute. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts + /// + /// + /// Operation Id + /// Compute_UpdateDataMounts + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual Response UpdateDataMounts(IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateDataMounts"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.UpdateDataMounts(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataMounts, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Posts a start action to a compute instance /// @@ -582,7 +666,7 @@ public virtual Response GetKeys(CancellationToken /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -624,7 +708,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -666,7 +750,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -708,7 +792,7 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -750,7 +834,7 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -792,7 +876,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -834,7 +918,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -876,7 +960,7 @@ public virtual async Task UpdateIdleShutdownSettingAsync(IdleShutdownS /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -904,5 +988,155 @@ public virtual Response UpdateIdleShutdownSetting(IdleShutdownSetting idleShutdo throw; } } + + /// + /// Returns supported virtual machine sizes for resize + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize + /// + /// + /// Operation Id + /// Compute_GetAllowedResizeSizes + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllowedResizeSizesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComputeComputeRestClient.CreateGetAllowedResizeSizesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => MachineLearningVmSize.DeserializeMachineLearningVmSize(e), _machineLearningComputeComputeClientDiagnostics, Pipeline, "MachineLearningComputeResource.GetAllowedResizeSizes", "value", null, cancellationToken); + } + + /// + /// Returns supported virtual machine sizes for resize + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize + /// + /// + /// Operation Id + /// Compute_GetAllowedResizeSizes + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllowedResizeSizes(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComputeComputeRestClient.CreateGetAllowedResizeSizesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => MachineLearningVmSize.DeserializeMachineLearningVmSize(e), _machineLearningComputeComputeClientDiagnostics, Pipeline, "MachineLearningComputeResource.GetAllowedResizeSizes", "value", null, cancellationToken); + } + + /// + /// Updates the size of a Compute Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize + /// + /// + /// Operation Id + /// Compute_Resize + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// is null. + public virtual async Task ResizeAsync(WaitUntil waitUntil, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.Resize"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.ResizeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateResizeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the size of a Compute Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize + /// + /// + /// Operation Id + /// Compute_Resize + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Resize(WaitUntil waitUntil, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.Resize"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.Resize(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateResizeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs index 16ebb0464898a..63341f92237ee 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string name, C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(string skip /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs index be0a588046f64..0e7865f5322b9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningDataVersionCollection GetMachineLearningDataVersio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetMachi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearningDa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs index d053c6e05fd07..dd3eb52e69aec 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -244,72 +244,6 @@ public virtual Response Get(string version, } } - /// - /// List data versions in the data container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions - /// - /// - /// Operation Id - /// DataVersions_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(MachineLearningDataVersionCollectionGetAllOptions options, CancellationToken cancellationToken = default) - { - options ??= new MachineLearningDataVersionCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningDataVersionDataVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningDataVersionDataVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningDataVersionResource(Client, MachineLearningDataVersionData.DeserializeMachineLearningDataVersionData(e)), _machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, "MachineLearningDataVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List data versions in the data container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions - /// - /// - /// Operation Id - /// DataVersions_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(MachineLearningDataVersionCollectionGetAllOptions options, CancellationToken cancellationToken = default) - { - options ??= new MachineLearningDataVersionCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningDataVersionDataVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningDataVersionDataVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.OrderBy, options.Top, options.Skip, options.Tags, options.ListViewType, options.Stage); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningDataVersionResource(Client, MachineLearningDataVersionData.DeserializeMachineLearningDataVersionData(e)), _machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, "MachineLearningDataVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - /// /// Checks to see if the resource exists in azure. /// @@ -323,7 +257,7 @@ public virtual Pageable GetAll(MachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +300,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +343,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +388,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -488,17 +422,17 @@ public virtual NullableResponse GetIfExists( IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { - return GetAllAsync(options: null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs index 66a29076b6b44..dcbd193c7e6d4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +319,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -352,5 +353,97 @@ public virtual ArmOperation Update(WaitUntil throw; } } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// DataVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningDataVersionDataVersionsClientDiagnostics.CreateScope("MachineLearningDataVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningDataVersionDataVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, _machineLearningDataVersionDataVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// DataVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningDataVersionDataVersionsClientDiagnostics.CreateScope("MachineLearningDataVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningDataVersionDataVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningDataVersionDataVersionsClientDiagnostics, Pipeline, _machineLearningDataVersionDataVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs index 9e062753196db..d7101b4dbb5d7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string name, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(Machi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -325,7 +325,7 @@ public virtual Pageable GetAll(MachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -411,7 +411,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs index 07e6fa766f44f..a9fda6a1e3aa3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreData.cs @@ -55,7 +55,7 @@ public partial class MachineLearningDatastoreData : ResourceData /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// /// is null. public MachineLearningDatastoreData(MachineLearningDatastoreProperties properties) @@ -73,7 +73,7 @@ public MachineLearningDatastoreData(MachineLearningDatastoreProperties propertie /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningDatastoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningDatastoreProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -90,7 +90,7 @@ internal MachineLearningDatastoreData() /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// public MachineLearningDatastoreProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs index 816ca2049dcaa..ff9e95fd0a30b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -376,14 +376,15 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// + /// Secret expiry information. /// The cancellation token to use. - public virtual async Task> GetSecretsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetSecretsAsync(SecretExpiry body = null, CancellationToken cancellationToken = default) { using var scope = _machineLearningDatastoreDatastoresClientDiagnostics.CreateScope("MachineLearningDatastoreResource.GetSecrets"); scope.Start(); try { - var response = await _machineLearningDatastoreDatastoresRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _machineLearningDatastoreDatastoresRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -406,7 +407,7 @@ public virtual async Task> GetSecretsA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -414,14 +415,15 @@ public virtual async Task> GetSecretsA /// /// /// + /// Secret expiry information. /// The cancellation token to use. - public virtual Response GetSecrets(CancellationToken cancellationToken = default) + public virtual Response GetSecrets(SecretExpiry body = null, CancellationToken cancellationToken = default) { using var scope = _machineLearningDatastoreDatastoresClientDiagnostics.CreateScope("MachineLearningDatastoreResource.GetSecrets"); scope.Start(); try { - var response = _machineLearningDatastoreDatastoresRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _machineLearningDatastoreDatastoresRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs index 42a7a93e8834c..17e38e1a8b24a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(stri /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs index d7a0b18316740..5fab01f3f34f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningEnvironmentVersionCollection GetMachineLearningEnv /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs index b85c7593612e7..effd1aa49ffa9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -244,76 +244,6 @@ public virtual Response Get(string ve } } - /// - /// List versions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions - /// - /// - /// Operation Id - /// EnvironmentVersions_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Ordering of list. - /// Maximum number of records to return. - /// Continuation token for pagination. - /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List versions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions - /// - /// - /// Operation Id - /// EnvironmentVersions_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Ordering of list. - /// Maximum number of records to return. - /// Continuation token for pagination. - /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); - } - /// /// Checks to see if the resource exists in azure. /// @@ -327,7 +257,7 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -370,7 +300,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -413,7 +343,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -458,7 +388,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs index 8bfd1ceeb9039..9994e06013c95 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +319,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -352,5 +353,97 @@ public virtual ArmOperation Update(Wa throw; } } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// EnvironmentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics.CreateScope("MachineLearningEnvironmentVersionResource.Publish"); + scope.Start(); + try + { + var response = await _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Publish version asset into registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish + /// + /// + /// Operation Id + /// EnvironmentVersions_Publish + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Destination registry info. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics.CreateScope("MachineLearningEnvironmentVersionResource.Publish"); + scope.Start(); + try + { + var response = _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningEnvironmentVersionEnvironmentVersionsClientDiagnostics, Pipeline, _machineLearningEnvironmentVersionEnvironmentVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs index 221eb1b0304e2..9e8a04b6b5616 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs @@ -14,6 +14,7 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -64,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -109,7 +110,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -154,7 +155,7 @@ public virtual Response Get(string featureName, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,16 +163,15 @@ public virtual Response Get(string featureName, /// /// /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// feature name. - /// Description of the featureset. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(MachineLearningFeatureCollectionGetAllOptions options, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); + options ??= new MachineLearningFeatureCollectionGetAllOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningFeatureResource(Client, MachineLearningFeatureData.DeserializeMachineLearningFeatureData(e)), _machineLearningFeatureFeaturesClientDiagnostics, Pipeline, "MachineLearningFeatureCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -196,16 +196,15 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// feature name. - /// Description of the featureset. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(MachineLearningFeatureCollectionGetAllOptions options, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, tags, featureName, description); + options ??= new MachineLearningFeatureCollectionGetAllOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, options.Skip, options.Tags, options.FeatureName, options.Description, options.ListViewType, pageSizeHint); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningFeatureResource(Client, MachineLearningFeatureData.DeserializeMachineLearningFeatureData(e)), _machineLearningFeatureFeaturesClientDiagnostics, Pipeline, "MachineLearningFeatureCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -222,7 +221,7 @@ public virtual Pageable GetAll(string skip = nul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,7 +264,7 @@ public virtual async Task> ExistsAsync(string featureName, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -308,7 +307,7 @@ public virtual Response Exists(string featureName, CancellationToken cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -353,7 +352,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -387,17 +386,17 @@ public virtual NullableResponse GetIfExists(stri IEnumerator IEnumerable.GetEnumerator() { - return GetAll().GetEnumerator(); + return GetAll(options: null).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetAll().GetEnumerator(); + return GetAll(options: null).GetEnumerator(); } IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + return GetAllAsync(options: null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs index d7a2f78df6520..33211318c5122 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs index bf6de70a563c9..3dab6499bc377 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string n /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(Machi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs index 40c0cd53934d0..bb908f9a86146 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningFeatureSetVersionCollection GetMachineLearningFeat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs index f7c25953bbdf5..8a5b4b3a3c27d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string ver /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(Machine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs index c0f9684df3960..0395b50ee21de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs @@ -9,7 +9,6 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.MachineLearning.Models; @@ -111,7 +110,7 @@ public virtual MachineLearningFeatureCollection GetMachineLearningFeatures() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -173,7 +172,7 @@ public virtual Response GetMachineLearningFeatur /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -213,7 +212,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +252,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -295,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -337,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -383,7 +382,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -429,7 +428,7 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -441,7 +440,7 @@ public virtual ArmOperation Update(Wai /// Feature set version backfill request entity. /// The cancellation token to use. /// is null. - public virtual async Task> BackfillAsync(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) + public virtual async Task> BackfillAsync(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); @@ -450,7 +449,7 @@ public virtual async Task> BackfillAs try { var response = await _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.BackfillAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningFeatureSetJobOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var operation = new MachineLearningArmOperation(new FeaturesetVersionBackfillResponseOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -475,7 +474,7 @@ public virtual async Task> BackfillAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -487,7 +486,7 @@ public virtual async Task> BackfillAs /// Feature set version backfill request entity. /// The cancellation token to use. /// is null. - public virtual ArmOperation Backfill(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Backfill(WaitUntil waitUntil, FeatureSetVersionBackfillContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); @@ -496,7 +495,7 @@ public virtual ArmOperation Backfill(WaitUntil wai try { var response = _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.Backfill(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningFeatureSetJobOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var operation = new MachineLearningArmOperation(new FeaturesetVersionBackfillResponseOperationSource(), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateBackfillRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -507,73 +506,5 @@ public virtual ArmOperation Backfill(WaitUntil wai throw; } } - - /// - /// List materialization Jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs - /// - /// - /// Operation Id - /// FeaturesetVersions_ListMaterializationJobs - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMaterializationJobsAsync(string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(e), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, "MachineLearningFeatureSetVersionResource.GetMaterializationJobs", "value", "nextLink", cancellationToken); - } - - /// - /// List materialization Jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs - /// - /// - /// Operation Id - /// FeaturesetVersions_ListMaterializationJobs - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMaterializationJobs(string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningFeatureSetVersionFeaturesetVersionsRestClient.CreateListMaterializationJobsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, skip, filters, featureWindowStart, featureWindowEnd); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(e), _machineLearningFeatureSetVersionFeaturesetVersionsClientDiagnostics, Pipeline, "MachineLearningFeatureSetVersionResource.GetMaterializationJobs", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs index 181271cd1a030..990f987da7cfc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs index 3a8fba4f69406..db0f598463d86 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningFeaturestoreEntityVersionCollection GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs index a88cb49ae24a2..c51e94fbb1ab4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs index b83bd7471276e..528eb1462229e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs index ab7df039fde28..6048e04e6ce19 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs @@ -54,6 +54,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. /// /// /// Request Path @@ -65,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -105,6 +106,7 @@ public virtual async Task> CreateOrUpda /// /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. /// /// /// Request Path @@ -116,7 +118,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +214,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +259,7 @@ public virtual Response Get(string id, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,15 +267,17 @@ public virtual Response Get(string id, CancellationT /// /// /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// Continuation token for pagination. + /// Type of job to be returned. + /// Jobs returned will have this tag key. + /// View type for including/excluding (for example) archived entities. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(MachineLearningJobCollectionGetAllOptions options, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { - options ??= new MachineLearningJobCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningJobResource(Client, MachineLearningJobData.DeserializeMachineLearningJobData(e)), _machineLearningJobJobsClientDiagnostics, Pipeline, "MachineLearningJobCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -290,7 +294,7 @@ public virtual AsyncPageable GetAllAsync(MachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -298,15 +302,17 @@ public virtual AsyncPageable GetAllAsync(MachineLear /// /// /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// Continuation token for pagination. + /// Type of job to be returned. + /// Jobs returned will have this tag key. + /// View type for including/excluding (for example) archived entities. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(MachineLearningJobCollectionGetAllOptions options, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { - options ??= new MachineLearningJobCollectionGetAllOptions(); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options.Skip, options.JobType, options.Tag, options.ListViewType, options.AssetName, options.Scheduled, options.ScheduleId); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningJobJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, jobType, tag, listViewType, properties); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningJobResource(Client, MachineLearningJobData.DeserializeMachineLearningJobData(e)), _machineLearningJobJobsClientDiagnostics, Pipeline, "MachineLearningJobCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +329,7 @@ public virtual Pageable GetAll(MachineLearningJobCol /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +372,7 @@ public virtual async Task> ExistsAsync(string id, CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +415,7 @@ public virtual Response Exists(string id, CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +460,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -488,17 +494,17 @@ public virtual NullableResponse GetIfExists(string i IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetAll(options: null).GetEnumerator(); + return GetAll().GetEnumerator(); } IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { - return GetAllAsync(options: null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs index e8901332f1c84..e8c603ed97dc6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs @@ -55,7 +55,7 @@ public partial class MachineLearningJobData : ResourceData /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// is null. public MachineLearningJobData(MachineLearningJobProperties properties) @@ -73,7 +73,7 @@ public MachineLearningJobData(MachineLearningJobProperties properties) /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -90,7 +90,7 @@ internal MachineLearningJobData() /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// public MachineLearningJobProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs index 7d4e1786983ed..156c6d736d825 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs @@ -11,7 +11,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.MachineLearning.Models; namespace Azure.ResourceManager.MachineLearning { @@ -102,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +181,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,90 +252,6 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } } - /// - /// Updates a Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id} - /// - /// - /// Operation Id - /// Jobs_Update - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _machineLearningJobJobsClientDiagnostics.CreateScope("MachineLearningJobResource.Update"); - scope.Start(); - try - { - var response = await _machineLearningJobJobsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new MachineLearningJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id} - /// - /// - /// Operation Id - /// Jobs_Update - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// is null. - public virtual Response Update(MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _machineLearningJobJobsClientDiagnostics.CreateScope("MachineLearningJobResource.Update"); - scope.Start(); - try - { - var response = _machineLearningJobJobsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - return Response.FromValue(new MachineLearningJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Cancels a Job (asynchronous). /// @@ -350,7 +265,7 @@ public virtual Response Update(MachineLearningJobPat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -392,7 +307,7 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs deleted file mode 100644 index ca6fde6957d72..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobCollection.cs +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.MachineLearning -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetMachineLearningLabelingJobs method from an instance of . - /// - public partial class MachineLearningLabelingJobCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _machineLearningLabelingJobLabelingJobsClientDiagnostics; - private readonly LabelingJobsRestOperations _machineLearningLabelingJobLabelingJobsRestClient; - - /// Initializes a new instance of the class for mocking. - protected MachineLearningLabelingJobCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal MachineLearningLabelingJobCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _machineLearningLabelingJobLabelingJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", MachineLearningLabelingJobResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MachineLearningLabelingJobResource.ResourceType, out string machineLearningLabelingJobLabelingJobsApiVersion); - _machineLearningLabelingJobLabelingJobsRestClient = new LabelingJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningLabelingJobLabelingJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The name and identifier for the LabelingJob. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The name and identifier for the LabelingJob. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Get"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Get"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists labeling jobs in the workspace. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs - /// - /// - /// Operation Id - /// LabelingJobs_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Number of labeling jobs to return. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skip = null, int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningLabelingJobResource(Client, MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(e)), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, "MachineLearningLabelingJobCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists labeling jobs in the workspace. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs - /// - /// - /// Operation Id - /// LabelingJobs_List - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Continuation token for pagination. - /// Number of labeling jobs to return. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skip = null, int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningLabelingJobLabelingJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningLabelingJobResource(Client, MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(e)), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, "MachineLearningLabelingJobCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Exists"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.Exists"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(id, nameof(id)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobCollection.GetIfExists"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, id, includeJobInstructions, includeLabelCategories, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs deleted file mode 100644 index a340fed61c4d3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.MachineLearning -{ - public partial class MachineLearningLabelingJobResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - MachineLearningLabelingJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - MachineLearningLabelingJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs deleted file mode 100644 index 40bd84343ee2d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobResource.cs +++ /dev/null @@ -1,608 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.MachineLearning.Models; - -namespace Azure.ResourceManager.MachineLearning -{ - /// - /// A Class representing a MachineLearningLabelingJob along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetMachineLearningLabelingJobResource method. - /// Otherwise you can get one from its parent resource using the GetMachineLearningLabelingJob method. - /// - public partial class MachineLearningLabelingJobResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The workspaceName. - /// The id. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string id) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _machineLearningLabelingJobLabelingJobsClientDiagnostics; - private readonly LabelingJobsRestOperations _machineLearningLabelingJobLabelingJobsRestClient; - private readonly MachineLearningLabelingJobData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/labelingJobs"; - - /// Initializes a new instance of the class for mocking. - protected MachineLearningLabelingJobResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal MachineLearningLabelingJobResource(ArmClient client, MachineLearningLabelingJobData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal MachineLearningLabelingJobResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _machineLearningLabelingJobLabelingJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string machineLearningLabelingJobLabelingJobsApiVersion); - _machineLearningLabelingJobLabelingJobsRestClient = new LabelingJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningLabelingJobLabelingJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual MachineLearningLabelingJobData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - public virtual async Task> GetAsync(bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Get"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, includeJobInstructions, includeLabelCategories, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a labeling job by name/id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Get - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. - /// The cancellation token to use. - public virtual Response Get(bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Get"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, includeJobInstructions, includeLabelCategories, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningLabelingJobResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Delete - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Delete"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _machineLearningLabelingJobLabelingJobsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MachineLearningArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_Delete - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Delete"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _machineLearningLabelingJobLabelingJobsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MachineLearningArmOperation(response, rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Update"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} - /// - /// - /// Operation Id - /// LabelingJobs_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// LabelingJob definition object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Update"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningLabelingJobOperationSource(Client), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Export labels from a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels - /// - /// - /// Operation Id - /// LabelingJobs_ExportLabels - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The export summary. - /// The cancellation token to use. - /// is null. - public virtual async Task> ExportLabelsAsync(WaitUntil waitUntil, ExportSummary body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.ExportLabels"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.ExportLabelsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new ExportSummaryOperationSource(), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateExportLabelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Export labels from a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels - /// - /// - /// Operation Id - /// LabelingJobs_ExportLabels - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The export summary. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation ExportLabels(WaitUntil waitUntil, ExportSummary body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.ExportLabels"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.ExportLabels(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); - var operation = new MachineLearningArmOperation(new ExportSummaryOperationSource(), _machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateExportLabelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause - /// - /// - /// Operation Id - /// LabelingJobs_Pause - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task PauseAsync(CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Pause"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.PauseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a labeling job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause - /// - /// - /// Operation Id - /// LabelingJobs_Pause - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Pause(CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Pause"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Pause(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resume a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume - /// - /// - /// Operation Id - /// LabelingJobs_Resume - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The cancellation token to use. - public virtual async Task ResumeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Resume"); - scope.Start(); - try - { - var response = await _machineLearningLabelingJobLabelingJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(_machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resume a labeling job (asynchronous). - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume - /// - /// - /// Operation Id - /// LabelingJobs_Resume - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// The cancellation token to use. - public virtual ArmOperation Resume(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _machineLearningLabelingJobLabelingJobsClientDiagnostics.CreateScope("MachineLearningLabelingJobResource.Resume"); - scope.Start(); - try - { - var response = _machineLearningLabelingJobLabelingJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new MachineLearningArmOperation(_machineLearningLabelingJobLabelingJobsClientDiagnostics, Pipeline, _machineLearningLabelingJobLabelingJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs index f8fd2b457c6fa..bb2a8d182a79d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string name, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(string ski /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs index 785cc4c4992a6..b00e62c329083 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningModelVersionCollection GetMachineLearningModelVers /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetMach /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLearningM /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs index c66981ce9e9d5..e8b2d0979f398 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -272,8 +272,8 @@ public virtual AsyncPageable GetAllAsync(Ma { options ??= new MachineLearningModelVersionCollectionGetAllOptions(); - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningModelVersionResource(Client, MachineLearningModelVersionData.DeserializeMachineLearningModelVersionData(e)), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, "MachineLearningModelVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Ma /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -305,8 +305,8 @@ public virtual Pageable GetAll(MachineLearn { options ??= new MachineLearningModelVersionCollectionGetAllOptions(); - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType, options.Stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningModelVersionModelVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningModelVersionModelVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options.Skip, options.OrderBy, options.Top, options.Version, options.Description, options.Offset, options.Tags, options.Properties, options.Feed, options.ListViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningModelVersionResource(Client, MachineLearningModelVersionData.DeserializeMachineLearningModelVersionData(e)), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, "MachineLearningModelVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +323,7 @@ public virtual Pageable GetAll(MachineLearn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs index e7934f1f69a50..5c9265e0d00de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -355,19 +355,19 @@ public virtual ArmOperation Update(WaitUnti } /// - /// Model Version Package operation. + /// Publish version asset into registry. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish /// /// /// Operation Id - /// ModelVersions_Package + /// ModelVersions_Publish /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -376,21 +376,21 @@ public virtual ArmOperation Update(WaitUnti /// /// /// 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. - /// Package operation request body. + /// Destination registry info. /// The cancellation token to use. - /// is null. - public virtual async Task> PackageAsync(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task PublishAsync(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Package"); + using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Publish"); scope.Start(); try { - var response = await _machineLearningModelVersionModelVersionsRestClient.PackageAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _machineLearningModelVersionModelVersionsRestClient.PublishAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -401,19 +401,19 @@ public virtual async Task> PackageAsync(WaitUnt } /// - /// Model Version Package operation. + /// Publish version asset into registry. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish /// /// /// Operation Id - /// ModelVersions_Package + /// ModelVersions_Publish /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -422,21 +422,21 @@ public virtual async Task> PackageAsync(WaitUnt /// /// /// 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. - /// Package operation request body. + /// Destination registry info. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Package(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Package"); + using var scope = _machineLearningModelVersionModelVersionsClientDiagnostics.CreateScope("MachineLearningModelVersionResource.Publish"); scope.Start(); try { - var response = _machineLearningModelVersionModelVersionsRestClient.Package(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _machineLearningModelVersionModelVersionsRestClient.Publish(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningModelVersionModelVersionsClientDiagnostics, Pipeline, _machineLearningModelVersionModelVersionsRestClient.CreatePublishRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + operation.WaitForCompletionResponse(cancellationToken); return operation; } catch (Exception e) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs index 4128a4d9cc932..acf141d84cf41 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string depl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(string o /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs index 4153515729794..b3fb27cea2c4d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(Wait /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual async Task> GetLogsAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual Response GetLogs(MachineLearningDe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -477,7 +477,7 @@ public virtual AsyncPageable GetSkusAsync(int? count = /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -509,7 +509,7 @@ public virtual Pageable GetSkus(int? count = null, str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -571,7 +571,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -633,7 +633,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -690,7 +690,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -747,7 +747,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -807,7 +807,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs index aaaa5bc97ad18..ffae53b3715df 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string endpoi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(MachineLea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs index 12d82c4951590..4acf9f2cc6121 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs @@ -110,7 +110,7 @@ public virtual MachineLearningOnlineDeploymentCollection GetMachineLearningOnlin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetMachineLearn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -550,7 +550,7 @@ public virtual async Task RegenerateKeysAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -596,7 +596,7 @@ public virtual ArmOperation RegenerateKeys(WaitUntil waitUntil, MachineLearningE /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -634,7 +634,7 @@ public virtual async Task> GetTokenAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -672,7 +672,7 @@ public virtual Response GetToken(CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -734,7 +734,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -796,7 +796,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -853,7 +853,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -910,7 +910,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -970,7 +970,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs index c16080455b007..939d358774003 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string rul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string ruleName, Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string ruleName, CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs index 54fd952bf6b24..6a9059c92decf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs @@ -13,10 +13,7 @@ namespace Azure.ResourceManager.MachineLearning { - /// - /// A class representing the MachineLearningOutboundRuleBasic data model. - /// Outbound Rule Basic Resource for the managed network of a machine learning workspace. - /// + /// A class representing the MachineLearningOutboundRuleBasic data model. public partial class MachineLearningOutboundRuleBasicData : ResourceData { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs index 0d961463788d4..e43b83bca4bdb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs index 08b5c0382805e..a0238bcf7f216 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs index ab906be394382..ef912fe2cd0f7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs @@ -84,7 +84,7 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("privateLinkServiceConnectionState"u8); writer.WriteObjectValue(ConnectionState, options); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs index 77eb1fe9e08eb..c822c370756b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs @@ -94,6 +94,6 @@ internal MachineLearningPrivateEndpointConnectionData() /// The connection state. public MachineLearningPrivateLinkServiceConnectionState ConnectionState { get; set; } /// The current provisioning state. - public MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + public MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs index 3684076c93721..2cd39cb1e131a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual ArmOperation Up /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -425,7 +425,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -482,7 +482,7 @@ public virtual Response AddTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -538,7 +538,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -594,7 +594,7 @@ public virtual Response SetTag /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs index 9a1adda7ef548..c01722e8cd9f8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string codeName, Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string codeName, CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs index 0050a4589bb2e..5eb50d213c7dd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryCodeVersionCollection GetMachineLearningRe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs index 5c2a5860602f0..cbd6538e876a7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string v /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs index 623e90614ee60..e8199e5890f49 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs index dd68d226f5dc4..69fab7b7df67c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string registryName /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string registryName, Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string registryName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs index 4a2528523b34e..f583515e0ebfa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs @@ -115,6 +115,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("managedResourceGroup"); } } + if (Optional.IsDefined(ManagedResourceGroupSettings)) + { + if (ManagedResourceGroupSettings != null) + { + writer.WritePropertyName("managedResourceGroupSettings"u8); + writer.WriteObjectValue(ManagedResourceGroupSettings, options); + } + else + { + writer.WriteNull("managedResourceGroupSettings"); + } + } if (Optional.IsDefined(MlFlowRegistryUri)) { if (MlFlowRegistryUri != null) @@ -127,13 +139,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("mlFlowRegistryUri"); } } - if (Optional.IsCollectionDefined(PrivateEndpointConnections)) + if (Optional.IsCollectionDefined(RegistryPrivateEndpointConnections)) { - if (PrivateEndpointConnections != null) + if (RegistryPrivateEndpointConnections != null) { - writer.WritePropertyName("privateEndpointConnections"u8); + writer.WritePropertyName("registryPrivateEndpointConnections"u8); writer.WriteStartArray(); - foreach (var item in PrivateEndpointConnections) + foreach (var item in RegistryPrivateEndpointConnections) { writer.WriteObjectValue(item, options); } @@ -141,7 +153,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } else { - writer.WriteNull("privateEndpointConnections"); + writer.WriteNull("registryPrivateEndpointConnections"); } } if (Optional.IsDefined(PublicNetworkAccess)) @@ -224,8 +236,9 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa Uri discoveryUrl = default; string intellectualPropertyPublisher = default; ArmResourceId managedResourceGroup = default; + ManagedResourceGroupSettings managedResourceGroupSettings = default; Uri mlFlowRegistryUri = default; - IList privateEndpointConnections = default; + IList registryPrivateEndpointConnections = default; string publicNetworkAccess = default; IList regionDetails = default; IDictionary serializedAdditionalRawData = default; @@ -338,6 +351,16 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa managedResourceGroup = ArmResourceId.DeserializeArmResourceId(property0.Value, options); continue; } + if (property0.NameEquals("managedResourceGroupSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + managedResourceGroupSettings = null; + continue; + } + managedResourceGroupSettings = ManagedResourceGroupSettings.DeserializeManagedResourceGroupSettings(property0.Value, options); + continue; + } if (property0.NameEquals("mlFlowRegistryUri"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -348,11 +371,11 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa mlFlowRegistryUri = new Uri(property0.Value.GetString()); continue; } - if (property0.NameEquals("privateEndpointConnections"u8)) + if (property0.NameEquals("registryPrivateEndpointConnections"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { - privateEndpointConnections = null; + registryPrivateEndpointConnections = null; continue; } List array = new List(); @@ -360,7 +383,7 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa { array.Add(RegistryPrivateEndpointConnection.DeserializeRegistryPrivateEndpointConnection(item, options)); } - privateEndpointConnections = array; + registryPrivateEndpointConnections = array; continue; } if (property0.NameEquals("publicNetworkAccess"u8)) @@ -410,8 +433,9 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa discoveryUrl, intellectualPropertyPublisher, managedResourceGroup, + managedResourceGroupSettings, mlFlowRegistryUri, - privateEndpointConnections ?? new ChangeTrackingList(), + registryPrivateEndpointConnections ?? new ChangeTrackingList(), publicNetworkAccess, regionDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs index c75a6e947b928..b58c8118ed34b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs @@ -52,7 +52,7 @@ public partial class MachineLearningRegistryData : TrackedResourceData /// The location. public MachineLearningRegistryData(AzureLocation location) : base(location) { - PrivateEndpointConnections = new ChangeTrackingList(); + RegistryPrivateEndpointConnections = new ChangeTrackingList(); RegionDetails = new ChangeTrackingList(); } @@ -69,15 +69,16 @@ public MachineLearningRegistryData(AzureLocation location) : base(location) /// Discovery URL for the Registry. /// IntellectualPropertyPublisher for the registry. /// ResourceId of the managed RG if the registry has system created resources. + /// Managed resource group specific settings. /// MLFlow Registry URI for the Registry. - /// Private endpoint connections info used for pending connections in private link portal. + /// Private endpoint connections info used for pending connections in private link portal. /// /// Is the Registry accessible from the internet? /// Possible values: "Enabled" or "Disabled" /// /// Details of each region the registry is in. /// Keeps track of any properties unknown to the library. - internal MachineLearningRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, Uri discoveryUri, string intellectualPropertyPublisher, ArmResourceId managedResourceGroup, Uri mlFlowRegistryUri, IList privateEndpointConnections, string publicNetworkAccess, IList regionDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MachineLearningRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, Uri discoveryUri, string intellectualPropertyPublisher, ArmResourceId managedResourceGroup, ManagedResourceGroupSettings managedResourceGroupSettings, Uri mlFlowRegistryUri, IList registryPrivateEndpointConnections, string publicNetworkAccess, IList regionDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Kind = kind; @@ -85,8 +86,9 @@ internal MachineLearningRegistryData(ResourceIdentifier id, string name, Resourc DiscoveryUri = discoveryUri; IntellectualPropertyPublisher = intellectualPropertyPublisher; ManagedResourceGroup = managedResourceGroup; + ManagedResourceGroupSettings = managedResourceGroupSettings; MlFlowRegistryUri = mlFlowRegistryUri; - PrivateEndpointConnections = privateEndpointConnections; + RegistryPrivateEndpointConnections = registryPrivateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; RegionDetails = regionDetails; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -124,10 +126,24 @@ public ResourceIdentifier ManagedResourceId } } + /// Managed resource group specific settings. + internal ManagedResourceGroupSettings ManagedResourceGroupSettings { get; set; } + /// List of assigned identities for the managed resource group. + public IList ManagedResourceGroupAssignedIdentities + { + get => ManagedResourceGroupSettings is null ? default : ManagedResourceGroupSettings.AssignedIdentities; + set + { + if (ManagedResourceGroupSettings is null) + ManagedResourceGroupSettings = new ManagedResourceGroupSettings(); + ManagedResourceGroupSettings.AssignedIdentities = value; + } + } + /// MLFlow Registry URI for the Registry. public Uri MlFlowRegistryUri { get; set; } /// Private endpoint connections info used for pending connections in private link portal. - public IList PrivateEndpointConnections { get; set; } + public IList RegistryPrivateEndpointConnections { get; set; } /// /// Is the Registry accessible from the internet? /// Possible values: "Enabled" or "Disabled" diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs index dd58d7f1fe37f..20c400a6e01b6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs index 88944d90eac99..f78de12c9c041 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryDataVersionCollection GetMachineLearningRe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs index a2632bf12181d..df93944ab685c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string v /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -329,7 +329,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -372,7 +372,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -415,7 +415,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -460,7 +460,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs index cf71022d53c89..fa4d25a7ff42b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs index 3e410cd346658..469b794f1519d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string environmentName, Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string environmentName, CancellationToken c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs index 959f528e5b3d7..b812f2ad22732 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryEnvironmentVersionCollection GetMachineLea /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs index cbc685e295d5d..00fc87675a378 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,13 +265,12 @@ public virtual Response Get(s /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningRegistryEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -288,7 +287,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -300,13 +299,12 @@ public virtual AsyncPageable /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType, stage); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, orderBy, top, skip, listViewType); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryEnvironmentVersionResource(Client, MachineLearningEnvironmentVersionData.DeserializeMachineLearningEnvironmentVersionData(e)), _machineLearningRegistryEnvironmentVersionRegistryEnvironmentVersionsClientDiagnostics, Pipeline, "MachineLearningRegistryEnvironmentVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -323,7 +321,7 @@ public virtual Pageable GetAl /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -366,7 +364,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -409,7 +407,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -454,7 +452,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs index c56b6b80ab461..781cf6fd96177 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs index 89556f401a556..5faf54f4eba8b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string modelName, Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string modelName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs index c7a069dc82c3f..f82fbb9a18ce2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs @@ -108,7 +108,7 @@ public virtual MachineLearningRegistryModelVersionCollection GetMachineLearningR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs index 2acfc862ee741..588cf26bbead7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(Mach /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs index fe99bdc237e0f..b3cc69fa826cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -346,98 +346,6 @@ public virtual ArmOperation Update( } } - /// - /// Model Version Package operation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package - /// - /// - /// Operation Id - /// RegistryModelVersions_Package - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// Package operation request body. - /// The cancellation token to use. - /// is null. - public virtual async Task> PackageAsync(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics.CreateScope("MachineLearningRegistryModelVersionResource.Package"); - scope.Start(); - try - { - var response = await _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.PackageAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics, Pipeline, _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Model Version Package operation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package - /// - /// - /// Operation Id - /// RegistryModelVersions_Package - /// - /// - /// Default Api Version - /// 2023-06-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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. - /// Package operation request body. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Package(WaitUntil waitUntil, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics.CreateScope("MachineLearningRegistryModelVersionResource.Package"); - scope.Start(); - try - { - var response = _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.Package(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new ModelPackageResultOperationSource(), _machineLearningRegistryModelVersionRegistryModelVersionsClientDiagnostics, Pipeline, _machineLearningRegistryModelVersionRegistryModelVersionsRestClient.CreatePackageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Generate a storage location and credential for the client to upload a model asset to. /// @@ -451,7 +359,7 @@ public virtual ArmOperation Package(WaitUntil waitUntil, Mod /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -493,7 +401,7 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs index fd6380308e8bd..4ffedbcaedb31 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs @@ -37,6 +37,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _machineLearningRegistryRegistriesClientDiagnostics; private readonly RegistriesRestOperations _machineLearningRegistryRegistriesRestClient; + private readonly ClientDiagnostics _registryDataReferencesClientDiagnostics; + private readonly RegistryDataReferencesRestOperations _registryDataReferencesRestClient; private readonly MachineLearningRegistryData _data; /// Gets the resource type for the operations. @@ -64,6 +66,8 @@ internal MachineLearningRegistryResource(ArmClient client, ResourceIdentifier id _machineLearningRegistryRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string machineLearningRegistryRegistriesApiVersion); _machineLearningRegistryRegistriesRestClient = new RegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningRegistryRegistriesApiVersion); + _registryDataReferencesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _registryDataReferencesRestClient = new RegistryDataReferencesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -110,7 +114,7 @@ public virtual MachineLearningRegistryCodeContainerCollection GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +145,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -179,7 +183,7 @@ public virtual MachineLearninRegistryComponentContainerCollection GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -210,7 +214,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -248,7 +252,7 @@ public virtual MachineLearningRegistryDataContainerCollection GetMachineLearning /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -279,7 +283,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +321,7 @@ public virtual MachineLearningRegistryEnvironmentContainerCollection GetMachineL /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -348,7 +352,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -386,7 +390,7 @@ public virtual MachineLearningRegistryModelContainerCollection GetMachineLearnin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -417,7 +421,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +452,7 @@ public virtual Response GetMachin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -488,7 +492,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -528,7 +532,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -570,7 +574,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -612,7 +616,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -654,7 +658,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -683,6 +687,92 @@ public virtual Response Update(MachineLearningR } } + /// + /// Get blob reference SAS Uri. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version} + /// + /// + /// Operation Id + /// RegistryDataReferences_GetBlobReferenceSas + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public virtual async Task> GetBlobReferenceSasRegistryDataReferenceAsync(string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _registryDataReferencesClientDiagnostics.CreateScope("MachineLearningRegistryResource.GetBlobReferenceSasRegistryDataReference"); + scope.Start(); + try + { + var response = await _registryDataReferencesRestClient.GetBlobReferenceSasAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, version, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get blob reference SAS Uri. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version} + /// + /// + /// Operation Id + /// RegistryDataReferences_GetBlobReferenceSas + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public virtual Response GetBlobReferenceSasRegistryDataReference(string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _registryDataReferencesClientDiagnostics.CreateScope("MachineLearningRegistryResource.GetBlobReferenceSasRegistryDataReference"); + scope.Start(); + try + { + var response = _registryDataReferencesRestClient.GetBlobReferenceSas(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, version, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Remove regions from registry /// @@ -696,7 +786,7 @@ public virtual Response Update(MachineLearningR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -742,7 +832,7 @@ public virtual async Task> RemoveR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -788,7 +878,7 @@ public virtual ArmOperation RemoveRegions(WaitU /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -850,7 +940,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -912,7 +1002,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -969,7 +1059,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1026,7 +1116,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1086,7 +1176,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs index 42b6caf4fd239..976f305e9a891 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string name, Cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(string skip = nu /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs index 7a96c93fb2cfe..e309c5f2fc01d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs index 4f45ed6a16df9..eacb178398128 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -74,7 +74,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. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -123,7 +123,7 @@ public virtual async Task> Create /// /// /// 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. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -171,7 +171,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -216,7 +216,7 @@ public virtual async Task> GetAsync(s /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -253,7 +253,7 @@ public virtual Response Get(string workspaceNa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -261,14 +261,15 @@ public virtual Response Get(string workspaceNa /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -285,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -293,14 +294,15 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skip = null, string kind = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, kind); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, kind); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -317,7 +319,7 @@ public virtual Pageable GetAll(string skip = n /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -325,7 +327,7 @@ public virtual Pageable GetAll(string skip = n /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -360,7 +362,7 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -368,7 +370,7 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -403,7 +405,7 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -411,7 +413,7 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -448,7 +450,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -456,7 +458,7 @@ public virtual async Task> Ge /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs index 4b998de842993..445b375eb7efc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string c /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -266,12 +266,13 @@ public virtual Response Get(string c /// /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string target = null, string category = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceConnectionResource(Client, MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(e)), _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -288,7 +289,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -298,12 +299,13 @@ public virtual AsyncPageable GetAllA /// /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string target = null, string category = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceConnectionResource(Client, MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(e)), _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -320,7 +322,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -363,7 +365,7 @@ public virtual async Task> ExistsAsync(string connectionName, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -406,7 +408,7 @@ public virtual Response Exists(string connectionName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -451,7 +453,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs index 961a1f3afc63d..5f9a695aeddcd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionData.cs @@ -51,7 +51,7 @@ public partial class MachineLearningWorkspaceConnectionData : ResourceData /// Initializes a new instance of . /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// /// is null. public MachineLearningWorkspaceConnectionData(MachineLearningWorkspaceConnectionProperties properties) @@ -68,7 +68,7 @@ public MachineLearningWorkspaceConnectionData(MachineLearningWorkspaceConnection /// The systemData. /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningWorkspaceConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningWorkspaceConnectionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -85,7 +85,7 @@ internal MachineLearningWorkspaceConnectionData() /// /// Gets or sets the properties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// public MachineLearningWorkspaceConnectionProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs index a20c7ae286cc9..205f66e7ff1bd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs @@ -9,6 +9,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.MachineLearning.Models; @@ -36,6 +37,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics; private readonly WorkspaceConnectionsRestOperations _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient; + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; private readonly MachineLearningWorkspaceConnectionData _data; /// Gets the resource type for the operations. @@ -63,6 +66,9 @@ internal MachineLearningWorkspaceConnectionResource(ArmClient client, ResourceId _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string machineLearningWorkspaceConnectionWorkspaceConnectionsApiVersion); _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient = new WorkspaceConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningWorkspaceConnectionWorkspaceConnectionsApiVersion); + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -89,6 +95,213 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of WorkspaceConnectionDeploymentResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of WorkspaceConnectionDeploymentResources and their operations over a WorkspaceConnectionDeploymentResource. + public virtual WorkspaceConnectionDeploymentCollection GetWorkspaceConnectionDeployments() + { + return GetCachedClient(client => new WorkspaceConnectionDeploymentCollection(client, Id)); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceConnectionDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceConnectionDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceConnectionDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetWorkspaceConnectionDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of RaiBlocklistPropertiesBasicResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of RaiBlocklistPropertiesBasicResources and their operations over a RaiBlocklistPropertiesBasicResource. + public virtual RaiBlocklistPropertiesBasicResourceCollection GetRaiBlocklistPropertiesBasicResources() + { + return GetCachedClient(client => new RaiBlocklistPropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRaiBlocklistPropertiesBasicResourceAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + return await GetRaiBlocklistPropertiesBasicResources().GetAsync(raiBlocklistName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRaiBlocklistPropertiesBasicResource(string raiBlocklistName, CancellationToken cancellationToken = default) + { + return GetRaiBlocklistPropertiesBasicResources().Get(raiBlocklistName, cancellationToken); + } + + /// Gets a collection of WorkspaceConnectionRaiPolicyResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of WorkspaceConnectionRaiPolicyResources and their operations over a WorkspaceConnectionRaiPolicyResource. + public virtual WorkspaceConnectionRaiPolicyCollection GetWorkspaceConnectionRaiPolicies() + { + return GetCachedClient(client => new WorkspaceConnectionRaiPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceConnectionRaiPolicyAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceConnectionRaiPolicies().GetAsync(raiPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceConnectionRaiPolicy(string raiPolicyName, CancellationToken cancellationToken = default) + { + return GetWorkspaceConnectionRaiPolicies().Get(raiPolicyName, cancellationToken); + } + /// /// Lists machine learning workspaces connections by name. /// @@ -102,7 +315,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -142,7 +355,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -182,7 +395,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -226,7 +439,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -270,7 +483,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -312,7 +525,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -354,7 +567,7 @@ public virtual Response Update(Machi /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -392,7 +605,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -416,5 +629,151 @@ public virtual Response GetSecrets(C throw; } } + + /// + /// Test machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection + /// + /// + /// Operation Id + /// WorkspaceConnections_TestConnection + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Workspace Connection object. + /// The cancellation token to use. + public virtual async Task TestConnectionAsync(WaitUntil waitUntil, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.TestConnection"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.TestConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateTestConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Test machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection + /// + /// + /// Operation Id + /// WorkspaceConnections_TestConnection + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Workspace Connection object. + /// The cancellation token to use. + public virtual ArmOperation TestConnection(WaitUntil waitUntil, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.TestConnection"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.TestConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateTestConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get available models under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models + /// + /// + /// Operation Id + /// Connection_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionResource.GetModelsConnections", "value", "nextLink", cancellationToken); + } + + /// + /// Get available models under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models + /// + /// + /// Operation Id + /// Connection_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModelsConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionResource.GetModelsConnections", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs index 889f237d0cebe..514bb6dfc90b8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs @@ -84,6 +84,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("allowPublicAccessWhenBehindVnet"u8); writer.WriteBooleanValue(AllowPublicAccessWhenBehindVnet.Value); } + if (Optional.IsDefined(AllowRoleAssignmentOnRG)) + { + writer.WritePropertyName("allowRoleAssignmentOnRG"u8); + writer.WriteBooleanValue(AllowRoleAssignmentOnRG.Value); + } if (Optional.IsDefined(ApplicationInsights)) { writer.WritePropertyName("applicationInsights"u8); @@ -129,6 +134,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("enableDataIsolation"u8); writer.WriteBooleanValue(EnableDataIsolation.Value); } + if (Optional.IsDefined(EnableServiceSideCMKEncryption)) + { + writer.WritePropertyName("enableServiceSideCMKEncryption"u8); + writer.WriteBooleanValue(EnableServiceSideCMKEncryption.Value); + } + if (Optional.IsDefined(EnableSimplifiedCmk)) + { + writer.WritePropertyName("enableSimplifiedCmk"u8); + writer.WriteBooleanValue(EnableSimplifiedCmk.Value); + } + if (Optional.IsDefined(EnableSoftwareBillOfMaterials)) + { + writer.WritePropertyName("enableSoftwareBillOfMaterials"u8); + writer.WriteBooleanValue(EnableSoftwareBillOfMaterials.Value); + } if (Optional.IsDefined(Encryption)) { writer.WritePropertyName("encryption"u8); @@ -169,6 +189,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("imageBuildCompute"u8); writer.WriteStringValue(ImageBuildCompute); } + if (Optional.IsCollectionDefined(IPAllowlist)) + { + writer.WritePropertyName("ipAllowlist"u8); + writer.WriteStartArray(); + foreach (var item in IPAllowlist) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(KeyVault)) { writer.WritePropertyName("keyVault"u8); @@ -229,6 +259,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("publicNetworkAccess"u8); writer.WriteStringValue(PublicNetworkAccessType.Value.ToString()); } + if (Optional.IsDefined(ServerlessComputeSettings)) + { + writer.WritePropertyName("serverlessComputeSettings"u8); + writer.WriteObjectValue(ServerlessComputeSettings, options); + } if (Optional.IsDefined(ServiceManagedResourcesSettings)) { writer.WritePropertyName("serviceManagedResourcesSettings"u8); @@ -348,6 +383,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace ResourceType type = default; SystemData systemData = default; bool? allowPublicAccessWhenBehindVnet = default; + bool? allowRoleAssignmentOnRG = default; string applicationInsights = default; IList associatedWorkspaces = default; IList containerRegistries = default; @@ -355,6 +391,9 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace string description = default; Uri discoveryUrl = default; bool? enableDataIsolation = default; + bool? enableServiceSideCMKEncryption = default; + bool? enableSimplifiedCmk = default; + bool? enableSoftwareBillOfMaterials = default; MachineLearningEncryptionSetting encryption = default; IList existingWorkspaces = default; FeatureStoreSettings featureStoreSettings = default; @@ -362,6 +401,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace bool? hbiWorkspace = default; ResourceIdentifier hubResourceId = default; string imageBuildCompute = default; + IList ipAllowlist = default; string keyVault = default; IList keyVaults = default; ManagedNetworkSettings managedNetwork = default; @@ -372,6 +412,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace int? privateLinkCount = default; MachineLearningProvisioningState? provisioningState = default; MachineLearningPublicNetworkAccessType? publicNetworkAccess = default; + ServerlessComputeSettings serverlessComputeSettings = default; ServiceManagedResourcesSettings serviceManagedResourcesSettings = default; string serviceProvisionedResourceGroup = default; IList sharedPrivateLinkResources = default; @@ -473,6 +514,15 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace allowPublicAccessWhenBehindVnet = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("allowRoleAssignmentOnRG"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowRoleAssignmentOnRG = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("applicationInsights"u8)) { applicationInsights = property0.Value.GetString(); @@ -534,6 +584,33 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace enableDataIsolation = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableServiceSideCMKEncryption"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableServiceSideCMKEncryption = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSimplifiedCmk"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSimplifiedCmk = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSoftwareBillOfMaterials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSoftwareBillOfMaterials = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("encryption"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -594,6 +671,20 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace imageBuildCompute = property0.Value.GetString(); continue; } + if (property0.NameEquals("ipAllowlist"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAllowlist = array; + continue; + } if (property0.NameEquals("keyVault"u8)) { keyVault = property0.Value.GetString(); @@ -686,6 +777,15 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace publicNetworkAccess = new MachineLearningPublicNetworkAccessType(property0.Value.GetString()); continue; } + if (property0.NameEquals("serverlessComputeSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); + continue; + } if (property0.NameEquals("serviceManagedResourcesSettings"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -808,6 +908,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace kind, sku, allowPublicAccessWhenBehindVnet, + allowRoleAssignmentOnRG, applicationInsights, associatedWorkspaces ?? new ChangeTrackingList(), containerRegistries ?? new ChangeTrackingList(), @@ -815,6 +916,9 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace description, discoveryUrl, enableDataIsolation, + enableServiceSideCMKEncryption, + enableSimplifiedCmk, + enableSoftwareBillOfMaterials, encryption, existingWorkspaces ?? new ChangeTrackingList(), featureStoreSettings, @@ -822,6 +926,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace hbiWorkspace, hubResourceId, imageBuildCompute, + ipAllowlist ?? new ChangeTrackingList(), keyVault, keyVaults ?? new ChangeTrackingList(), managedNetwork, @@ -832,6 +937,7 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace privateLinkCount, provisioningState, publicNetworkAccess, + serverlessComputeSettings, serviceManagedResourcesSettings, serviceProvisionedResourceGroup, sharedPrivateLinkResources ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs index 0a2cbb29eed3d..40bbc153be846 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs @@ -58,6 +58,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) AssociatedWorkspaces = new ChangeTrackingList(); ContainerRegistries = new ChangeTrackingList(); ExistingWorkspaces = new ChangeTrackingList(); + IPAllowlist = new ChangeTrackingList(); KeyVaults = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); SharedPrivateLinkResources = new ChangeTrackingList(); @@ -75,6 +76,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. /// The flag to indicate whether to allow public access when behind VNet. + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. /// ARM id of the application insights associated with this workspace. /// /// @@ -82,6 +84,9 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// The description of this workspace. /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. /// + /// + /// Flag to tell if simplified CMK should be enabled for this workspace. + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. /// /// /// Settings for feature store type workspace. @@ -89,6 +94,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. /// /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. /// /// Managed Network settings for a machine learning workspace. @@ -99,6 +105,7 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// Count of private connections in the workspace. /// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. /// The service managed resource settings. /// The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace. /// The list of shared private link resources in this workspace. @@ -112,12 +119,13 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// WorkspaceHub's configuration object. /// The immutable id associated with this workspace. /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, bool? allowPublicAccessWhenBehindVnet, string applicationInsights, IList associatedWorkspaces, IList containerRegistries, string containerRegistry, string description, Uri discoveryUri, bool? enableDataIsolation, MachineLearningEncryptionSetting encryption, IList existingWorkspaces, FeatureStoreSettings featureStoreSettings, string friendlyName, bool? isHbiWorkspace, ResourceIdentifier hubResourceId, string imageBuildCompute, string keyVault, IList keyVaults, ManagedNetworkSettings managedNetwork, Uri mlFlowTrackingUri, MachineLearningNotebookResourceInfo notebookInfo, string primaryUserAssignedIdentity, IReadOnlyList privateEndpointConnections, int? privateLinkCount, MachineLearningProvisioningState? provisioningState, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string serviceProvisionedResourceGroup, IList sharedPrivateLinkResources, int? softDeleteRetentionInDays, string storageAccount, IList storageAccounts, bool? isStorageHnsEnabled, string systemDatastoresAuthMode, Guid? tenantId, bool? isV1LegacyMode, WorkspaceHubConfig workspaceHubConfig, string workspaceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, bool? allowPublicAccessWhenBehindVnet, bool? allowRoleAssignmentOnRG, string applicationInsights, IList associatedWorkspaces, IList containerRegistries, string containerRegistry, string description, Uri discoveryUri, bool? enableDataIsolation, bool? enableServiceSideCMKEncryption, bool? enableSimplifiedCmk, bool? enableSoftwareBillOfMaterials, MachineLearningEncryptionSetting encryption, IList existingWorkspaces, FeatureStoreSettings featureStoreSettings, string friendlyName, bool? isHbiWorkspace, ResourceIdentifier hubResourceId, string imageBuildCompute, IList ipAllowlist, string keyVault, IList keyVaults, ManagedNetworkSettings managedNetwork, Uri mlFlowTrackingUri, MachineLearningNotebookResourceInfo notebookInfo, string primaryUserAssignedIdentity, IReadOnlyList privateEndpointConnections, int? privateLinkCount, MachineLearningProvisioningState? provisioningState, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServerlessComputeSettings serverlessComputeSettings, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string serviceProvisionedResourceGroup, IList sharedPrivateLinkResources, int? softDeleteRetentionInDays, string storageAccount, IList storageAccounts, bool? isStorageHnsEnabled, string systemDatastoresAuthMode, Guid? tenantId, bool? isV1LegacyMode, WorkspaceHubConfig workspaceHubConfig, string workspaceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Kind = kind; Sku = sku; AllowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + AllowRoleAssignmentOnRG = allowRoleAssignmentOnRG; ApplicationInsights = applicationInsights; AssociatedWorkspaces = associatedWorkspaces; ContainerRegistries = containerRegistries; @@ -125,6 +133,9 @@ internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, Resour Description = description; DiscoveryUri = discoveryUri; EnableDataIsolation = enableDataIsolation; + EnableServiceSideCMKEncryption = enableServiceSideCMKEncryption; + EnableSimplifiedCmk = enableSimplifiedCmk; + EnableSoftwareBillOfMaterials = enableSoftwareBillOfMaterials; Encryption = encryption; ExistingWorkspaces = existingWorkspaces; FeatureStoreSettings = featureStoreSettings; @@ -132,6 +143,7 @@ internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, Resour IsHbiWorkspace = isHbiWorkspace; HubResourceId = hubResourceId; ImageBuildCompute = imageBuildCompute; + IPAllowlist = ipAllowlist; KeyVault = keyVault; KeyVaults = keyVaults; ManagedNetwork = managedNetwork; @@ -142,6 +154,7 @@ internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, Resour PrivateLinkCount = privateLinkCount; ProvisioningState = provisioningState; PublicNetworkAccessType = publicNetworkAccessType; + ServerlessComputeSettings = serverlessComputeSettings; ServiceManagedResourcesSettings = serviceManagedResourcesSettings; ServiceProvisionedResourceGroup = serviceProvisionedResourceGroup; SharedPrivateLinkResources = sharedPrivateLinkResources; @@ -170,6 +183,8 @@ internal MachineLearningWorkspaceData() public MachineLearningSku Sku { get; set; } /// The flag to indicate whether to allow public access when behind VNet. public bool? AllowPublicAccessWhenBehindVnet { get; set; } + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. + public bool? AllowRoleAssignmentOnRG { get; set; } /// ARM id of the application insights associated with this workspace. public string ApplicationInsights { get; set; } /// Gets the associated workspaces. @@ -184,6 +199,12 @@ internal MachineLearningWorkspaceData() public Uri DiscoveryUri { get; set; } /// Gets or sets the enable data isolation. public bool? EnableDataIsolation { get; set; } + /// Gets or sets the enable service side cmk encryption. + public bool? EnableServiceSideCMKEncryption { get; set; } + /// Flag to tell if simplified CMK should be enabled for this workspace. + public bool? EnableSimplifiedCmk { get; set; } + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + public bool? EnableSoftwareBillOfMaterials { get; set; } /// Gets or sets the encryption. public MachineLearningEncryptionSetting Encryption { get; set; } /// Gets the existing workspaces. @@ -198,6 +219,8 @@ internal MachineLearningWorkspaceData() public ResourceIdentifier HubResourceId { get; set; } /// The compute name for image build. public string ImageBuildCompute { get; set; } + /// The list of IPv4 addresses that are allowed to access the workspace. + public IList IPAllowlist { get; } /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. public string KeyVault { get; set; } /// Gets the key vaults. @@ -218,6 +241,8 @@ internal MachineLearningWorkspaceData() public MachineLearningProvisioningState? ProvisioningState { get; } /// Whether requests from Public Network are allowed. public MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get; set; } + /// Settings for serverless compute in a workspace. + public ServerlessComputeSettings ServerlessComputeSettings { get; set; } /// The service managed resource settings. internal ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } /// Gets or sets the cosmos db collections throughput. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs index 38f807b23fe9c..4ae5e56ea584c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs @@ -40,6 +40,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly WorkspacesRestOperations _machineLearningWorkspaceWorkspacesRestClient; private readonly ClientDiagnostics _workspaceFeaturesClientDiagnostics; private readonly WorkspaceFeaturesRestOperations _workspaceFeaturesRestClient; + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly ClientDiagnostics _managedNetworkProvisionsClientDiagnostics; @@ -73,6 +77,12 @@ internal MachineLearningWorkspaceResource(ArmClient client, ResourceIdentifier i _machineLearningWorkspaceWorkspacesRestClient = new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningWorkspaceWorkspacesApiVersion); _workspaceFeaturesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); _workspaceFeaturesRestClient = new WorkspaceFeaturesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointDeploymentResource.ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _managedNetworkProvisionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); @@ -123,7 +133,7 @@ public virtual MachineLearningComputeCollection GetMachineLearningComputes() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -154,7 +164,7 @@ public virtual async Task> GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -192,7 +202,7 @@ public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeCont /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -223,7 +233,7 @@ public virtual async Task> GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -261,7 +271,7 @@ public virtual MachineLearningComponentContainerCollection GetMachineLearningCom /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -292,7 +302,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -330,7 +340,7 @@ public virtual MachineLearningDataContainerCollection GetMachineLearningDataCont /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -361,7 +371,7 @@ public virtual async Task> GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -399,7 +409,7 @@ public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningE /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -430,7 +440,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -448,6 +458,75 @@ public virtual Response GetMachineL return GetMachineLearningEnvironmentContainers().Get(name, cancellationToken); } + /// Gets a collection of MarketplaceSubscriptionResources in the MachineLearningWorkspace. + /// An object representing collection of MarketplaceSubscriptionResources and their operations over a MarketplaceSubscriptionResource. + public virtual MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() + { + return GetCachedClient(client => new MarketplaceSubscriptionCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMarketplaceSubscriptionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMarketplaceSubscriptions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMarketplaceSubscription(string name, CancellationToken cancellationToken = default) + { + return GetMarketplaceSubscriptions().Get(name, cancellationToken); + } + /// Gets a collection of MachineLearningModelContainerResources in the MachineLearningWorkspace. /// An object representing collection of MachineLearningModelContainerResources and their operations over a MachineLearningModelContainerResource. public virtual MachineLearningModelContainerCollection GetMachineLearningModelContainers() @@ -468,7 +547,7 @@ public virtual MachineLearningModelContainerCollection GetMachineLearningModelCo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -499,7 +578,7 @@ public virtual async Task> GetMa /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -537,7 +616,7 @@ public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEnd /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -568,7 +647,7 @@ public virtual async Task> GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -606,7 +685,7 @@ public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -637,7 +716,7 @@ public virtual async Task> GetMachine /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -675,7 +754,7 @@ public virtual MachineLearningFeatureSetContainerCollection GetMachineLearningFe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -706,7 +785,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -744,7 +823,7 @@ public virtual MachineLearningFeatureStoreEntityContainerCollection GetMachineLe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -775,7 +854,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -813,7 +892,7 @@ public virtual MachineLearningJobCollection GetMachineLearningJobs() /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -844,7 +923,7 @@ public virtual async Task> GetMachineLearni /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -862,215 +941,211 @@ public virtual Response GetMachineLearningJob(string return GetMachineLearningJobs().Get(id, cancellationToken); } - /// Gets a collection of MachineLearningLabelingJobResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningLabelingJobResources and their operations over a MachineLearningLabelingJobResource. - public virtual MachineLearningLabelingJobCollection GetMachineLearningLabelingJobs() + /// Gets a collection of MachineLearningOnlineEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. + public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() { - return GetCachedClient(client => new MachineLearningLabelingJobCollection(client, Id)); + return GetCachedClient(client => new MachineLearningOnlineEndpointCollection(client, Id)); } /// - /// Gets a labeling job by name/id. + /// Get Online Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} /// /// /// Operation Id - /// LabelingJobs_Get + /// OnlineEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Online Endpoint name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningLabelingJobAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningOnlineEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { - return await GetMachineLearningLabelingJobs().GetAsync(id, includeJobInstructions, includeLabelCategories, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningOnlineEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a labeling job by name/id. + /// Get Online Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} /// /// /// Operation Id - /// LabelingJobs_Get + /// OnlineEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Online Endpoint name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningLabelingJob(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningOnlineEndpoint(string endpointName, CancellationToken cancellationToken = default) { - return GetMachineLearningLabelingJobs().Get(id, includeJobInstructions, includeLabelCategories, cancellationToken); + return GetMachineLearningOnlineEndpoints().Get(endpointName, cancellationToken); } - /// Gets a collection of MachineLearningOnlineEndpointResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. - public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() + /// Gets a collection of MachineLearningScheduleResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningScheduleResources and their operations over a MachineLearningScheduleResource. + public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() { - return GetCachedClient(client => new MachineLearningOnlineEndpointCollection(client, Id)); + return GetCachedClient(client => new MachineLearningScheduleCollection(client, Id)); } /// - /// Get Online Endpoint. + /// Get schedule. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} /// /// /// Operation Id - /// OnlineEndpoints_Get + /// Schedules_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Online Endpoint name. + /// Schedule name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningOnlineEndpointAsync(string endpointName, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningScheduleAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningOnlineEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningSchedules().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// - /// Get Online Endpoint. + /// Get schedule. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} /// /// /// Operation Id - /// OnlineEndpoints_Get + /// Schedules_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Online Endpoint name. + /// Schedule name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningOnlineEndpoint(string endpointName, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningOnlineEndpoints().Get(endpointName, cancellationToken); + return GetMachineLearningSchedules().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningScheduleResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningScheduleResources and their operations over a MachineLearningScheduleResource. - public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() + /// Gets a collection of ServerlessEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of ServerlessEndpointResources and their operations over a ServerlessEndpointResource. + public virtual ServerlessEndpointCollection GetServerlessEndpoints() { - return GetCachedClient(client => new MachineLearningScheduleCollection(client, Id)); + return GetCachedClient(client => new ServerlessEndpointCollection(client, Id)); } /// - /// Get schedule. + /// Get Serverless Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} /// /// /// Operation Id - /// Schedules_Get + /// ServerlessEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Schedule name. + /// Serverless Endpoint name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningScheduleAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetServerlessEndpointAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningSchedules().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetServerlessEndpoints().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// - /// Get schedule. + /// Get Serverless Endpoint. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} /// /// /// Operation Id - /// Schedules_Get + /// ServerlessEndpoints_Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Schedule name. + /// Serverless Endpoint name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) + public virtual Response GetServerlessEndpoint(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningSchedules().Get(name, cancellationToken); + return GetServerlessEndpoints().Get(name, cancellationToken); } /// Gets a collection of MachineLearningWorkspaceConnectionResources in the MachineLearningWorkspace. @@ -1093,7 +1168,7 @@ public virtual MachineLearningWorkspaceConnectionCollection GetMachineLearningWo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1124,7 +1199,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1142,6 +1217,75 @@ public virtual Response GetMachineLe return GetMachineLearningWorkspaceConnections().Get(connectionName, cancellationToken); } + /// Gets a collection of EndpointResourcePropertiesBasicResources in the MachineLearningWorkspace. + /// An object representing collection of EndpointResourcePropertiesBasicResources and their operations over a EndpointResourcePropertiesBasicResource. + public virtual EndpointResourcePropertiesBasicResourceCollection GetEndpointResourcePropertiesBasicResources() + { + return GetCachedClient(client => new EndpointResourcePropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEndpointResourcePropertiesBasicResourceAsync(string endpointName, CancellationToken cancellationToken = default) + { + return await GetEndpointResourcePropertiesBasicResources().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEndpointResourcePropertiesBasicResource(string endpointName, CancellationToken cancellationToken = default) + { + return GetEndpointResourcePropertiesBasicResources().Get(endpointName, cancellationToken); + } + /// Gets a collection of MachineLearningOutboundRuleBasicResources in the MachineLearningWorkspace. /// An object representing collection of MachineLearningOutboundRuleBasicResources and their operations over a MachineLearningOutboundRuleBasicResource. public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutboundRuleBasics() @@ -1162,7 +1306,7 @@ public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutb /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1193,7 +1337,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1231,7 +1375,7 @@ public virtual MachineLearningPrivateEndpointConnectionCollection GetMachineLear /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1262,7 +1406,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1293,7 +1437,7 @@ public virtual Response GetMac /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1333,7 +1477,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1373,7 +1517,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1416,7 +1560,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1459,7 +1603,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceToPurge = nul /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1505,7 +1649,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1551,7 +1695,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1577,7 +1721,7 @@ public virtual AsyncPageable GetWorkspaceFeaturesAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -1603,7 +1747,7 @@ public virtual Pageable GetWorkspaceFeatures(Cancell /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1646,7 +1790,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1689,7 +1833,7 @@ public virtual ArmOperation Diagnose(Wai /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1727,7 +1871,7 @@ public virtual async Task> GetKe /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1765,7 +1909,7 @@ public virtual Response GetKeys(Cancellat /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1803,7 +1947,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1841,7 +1985,7 @@ public virtual Response GetNo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1879,7 +2023,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1917,7 +2061,7 @@ public virtual Response GetNotebo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1955,7 +2099,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -1993,7 +2137,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2022,7 +2166,7 @@ public virtual AsyncPageable GetOutboundNetworkDep /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2051,7 +2195,7 @@ public virtual Pageable GetOutboundNetworkDependen /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2093,7 +2237,7 @@ public virtual async Task> Pre /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2135,7 +2279,7 @@ public virtual ArmOperation PrepareNotebook /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2177,7 +2321,7 @@ public virtual async Task ResyncKeysAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2206,6 +2350,128 @@ public virtual ArmOperation ResyncKeys(WaitUntil waitUntil, CancellationToken ca } } + /// + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels + /// + /// + /// Operation Id + /// Connection_ListModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetModelsConnections", "value", null, cancellationToken); + } + + /// + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels + /// + /// + /// Operation Id + /// Connection_ListModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModelsConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetModelsConnections", "value", null, cancellationToken); + } + + /// + /// Get all the deployments under the workspace scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_GetInWorkspace + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetInWorkspaceEndpointDeploymentsAsync(EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetInWorkspaceEndpointDeployments", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the workspace scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_GetInWorkspace + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetInWorkspaceEndpointDeployments(EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetInWorkspaceEndpointDeployments", "value", "nextLink", cancellationToken); + } + /// /// Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. /// Each "private link resource" is a connection endpoint (IP address) to the resource. @@ -2223,7 +2489,7 @@ public virtual ArmOperation ResyncKeys(WaitUntil waitUntil, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2252,7 +2518,7 @@ public virtual AsyncPageable GetPrivateLinkR /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2277,7 +2543,7 @@ public virtual Pageable GetPrivateLinkResour /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2316,7 +2582,7 @@ public virtual async Task> Provision /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// @@ -2355,7 +2621,7 @@ public virtual ArmOperation ProvisionManagedNetwo /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2417,7 +2683,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2479,7 +2745,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2536,7 +2802,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2593,7 +2859,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource @@ -2653,7 +2919,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2023-06-01-preview + /// 2024-07-01-preview /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs new file mode 100644 index 0000000000000..a5a48c172723f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMarketplaceSubscriptions method from an instance of . + /// + public partial class MarketplaceSubscriptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _marketplaceSubscriptionClientDiagnostics; + private readonly MarketplaceSubscriptionsRestOperations _marketplaceSubscriptionRestClient; + + /// Initializes a new instance of the class for mocking. + protected MarketplaceSubscriptionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MarketplaceSubscriptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _marketplaceSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", MarketplaceSubscriptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MarketplaceSubscriptionResource.ResourceType, out string marketplaceSubscriptionApiVersion); + _marketplaceSubscriptionRestClient = new MarketplaceSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, marketplaceSubscriptionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Get"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Get"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List containers. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _marketplaceSubscriptionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _marketplaceSubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MarketplaceSubscriptionResource(Client, MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(e)), _marketplaceSubscriptionClientDiagnostics, Pipeline, "MarketplaceSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List containers. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _marketplaceSubscriptionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _marketplaceSubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MarketplaceSubscriptionResource(Client, MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(e)), _marketplaceSubscriptionClientDiagnostics, Pipeline, "MarketplaceSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Exists"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.Exists"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.Serialization.cs similarity index 70% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.Serialization.cs index 4a0b2fbf85dd5..7e8c7978e0755 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.MachineLearning { - public partial class MachineLearningLabelingJobData : IUtf8JsonSerializable, IJsonModel + public partial class MarketplaceSubscriptionData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -68,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - MachineLearningLabelingJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MarketplaceSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningLabelingJobData(document.RootElement, options); + return DeserializeMarketplaceSubscriptionData(document.RootElement, options); } - internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelingJobData(JsonElement element, ModelReaderWriterOptions options = null) + internal static MarketplaceSubscriptionData DeserializeMarketplaceSubscriptionData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +88,7 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin { return null; } - LabelingJobProperties properties = default; + MarketplaceSubscriptionProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -99,7 +99,7 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin { if (property.NameEquals("properties"u8)) { - properties = LabelingJobProperties.DeserializeLabelingJobProperties(property.Value, options); + properties = MarketplaceSubscriptionProperties.DeserializeMarketplaceSubscriptionProperties(property.Value, options); continue; } if (property.NameEquals("id"u8)) @@ -132,7 +132,7 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningLabelingJobData( + return new MarketplaceSubscriptionData( id, name, type, @@ -141,35 +141,35 @@ internal static MachineLearningLabelingJobData DeserializeMachineLearningLabelin serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support writing '{options.Format}' format."); } } - MachineLearningLabelingJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MarketplaceSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningLabelingJobData(document.RootElement, options); + return DeserializeMarketplaceSubscriptionData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MachineLearningLabelingJobData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.cs similarity index 79% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.cs index 57bba6be68773..d1090441f2626 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningLabelingJobData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.MachineLearning { /// - /// A class representing the MachineLearningLabelingJob data model. + /// A class representing the MarketplaceSubscription data model. /// Azure Resource Manager resource envelope. /// - public partial class MachineLearningLabelingJobData : ResourceData + public partial class MarketplaceSubscriptionData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,35 +51,35 @@ public partial class MachineLearningLabelingJobData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// [Required] Additional attributes of the entity. /// is null. - public MachineLearningLabelingJobData(LabelingJobProperties properties) + public MarketplaceSubscriptionData(MarketplaceSubscriptionProperties properties) { Argument.AssertNotNull(properties, nameof(properties)); Properties = properties; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// [Required] Additional attributes of the entity. /// Keeps track of any properties unknown to the library. - internal MachineLearningLabelingJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, LabelingJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal MarketplaceSubscriptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MarketplaceSubscriptionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MachineLearningLabelingJobData() + /// Initializes a new instance of for deserialization. + internal MarketplaceSubscriptionData() { } /// [Required] Additional attributes of the entity. - public LabelingJobProperties Properties { get; set; } + public MarketplaceSubscriptionProperties Properties { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs new file mode 100644 index 0000000000000..129893722053a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class MarketplaceSubscriptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MarketplaceSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MarketplaceSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs new file mode 100644 index 0000000000000..055ef0d1c33b5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a MarketplaceSubscription along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMarketplaceSubscriptionResource method. + /// Otherwise you can get one from its parent resource using the GetMarketplaceSubscription method. + /// + public partial class MarketplaceSubscriptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _marketplaceSubscriptionClientDiagnostics; + private readonly MarketplaceSubscriptionsRestOperations _marketplaceSubscriptionRestClient; + private readonly MarketplaceSubscriptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/marketplaceSubscriptions"; + + /// Initializes a new instance of the class for mocking. + protected MarketplaceSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MarketplaceSubscriptionResource(ArmClient client, MarketplaceSubscriptionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MarketplaceSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _marketplaceSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string marketplaceSubscriptionApiVersion); + _marketplaceSubscriptionRestClient = new MarketplaceSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, marketplaceSubscriptionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MarketplaceSubscriptionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Get"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Get"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MarketplaceSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Update"); + scope.Start(); + try + { + var response = await _marketplaceSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Marketplace Subscription (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _marketplaceSubscriptionClientDiagnostics.CreateScope("MarketplaceSubscriptionResource.Update"); + scope.Start(); + try + { + var response = _marketplaceSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new MarketplaceSubscriptionOperationSource(Client), _marketplaceSubscriptionClientDiagnostics, Pipeline, _marketplaceSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs new file mode 100644 index 0000000000000..b42ef8374b1c7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AadAuthTypeWorkspaceConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AadAuthTypeWorkspaceConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAadAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + + internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeWorkspaceConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningConnectionAuthType authType = default; + MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = new MachineLearningConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new MachineLearningConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AadAuthTypeWorkspaceConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AadAuthTypeWorkspaceConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAadAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AadAuthTypeWorkspaceConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs new file mode 100644 index 0000000000000..289ac575a90b7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// This connection type covers the AAD auth for any applicable Azure service. + public partial class AadAuthTypeWorkspaceConnectionProperties : MachineLearningWorkspaceConnectionProperties + { + /// Initializes a new instance of . + public AadAuthTypeWorkspaceConnectionProperties() + { + AuthType = MachineLearningConnectionAuthType.Aad; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + AuthType = authType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs index 9f9c349491773..c3cee5f528c32 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess WorkspaceConnectionAccessKey credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess return new AccessKeyAuthTypeWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs index d716f8bfb5cc6..3ad0c6a0718ba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public AccessKeyAuthTypeWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccessKey credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccessKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs index 8301b71e96918..bd95d002cfea6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs @@ -13,30 +13,28 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class PartialJobBase : IUtf8JsonSerializable, IJsonModel + public partial class AccountApiKeys : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialJobBase)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(NotificationSetting)) + if (Optional.IsDefined(Key1)) { - if (NotificationSetting != null) - { - writer.WritePropertyName("notificationSetting"u8); - writer.WriteObjectValue(NotificationSetting, options); - } - else - { - writer.WriteNull("notificationSetting"); - } + writer.WritePropertyName("key1"u8); + writer.WriteStringValue(Key1); + } + if (Optional.IsDefined(Key2)) + { + writer.WritePropertyName("key2"u8); + writer.WriteStringValue(Key2); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WriteEndObject(); } - PartialJobBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AccountApiKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialJobBase)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePartialJobBase(document.RootElement, options); + return DeserializeAccountApiKeys(document.RootElement, options); } - internal static PartialJobBase DeserializePartialJobBase(JsonElement element, ModelReaderWriterOptions options = null) + internal static AccountApiKeys DeserializeAccountApiKeys(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,19 +74,20 @@ internal static PartialJobBase DeserializePartialJobBase(JsonElement element, Mo { return null; } - PartialNotificationSetting notificationSetting = default; + string key1 = default; + string key2 = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("notificationSetting"u8)) + if (property.NameEquals("key1"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - notificationSetting = null; - continue; - } - notificationSetting = PartialNotificationSetting.DeserializePartialNotificationSetting(property.Value, options); + key1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("key2"u8)) + { + key2 = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +96,38 @@ internal static PartialJobBase DeserializePartialJobBase(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new PartialJobBase(notificationSetting, serializedAdditionalRawData); + return new AccountApiKeys(key1, key2, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PartialJobBase)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support writing '{options.Format}' format."); } } - PartialJobBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AccountApiKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePartialJobBase(document.RootElement, options); + return DeserializeAccountApiKeys(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PartialJobBase)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs similarity index 71% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs index e04ee3590fa62..cb65f77cb4ff7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// The AutoDeleteSetting. - public partial class AutoDeleteSetting + /// The AccountApiKeys. + public partial class AccountApiKeys { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,25 @@ public partial class AutoDeleteSetting /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AutoDeleteSetting() + /// Initializes a new instance of . + internal AccountApiKeys() { } - /// Initializes a new instance of . - /// When to check if an asset is expired. - /// Expiration condition value. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal AutoDeleteSetting(AutoDeleteCondition? condition, string value, IDictionary serializedAdditionalRawData) + internal AccountApiKeys(string key1, string key2, IDictionary serializedAdditionalRawData) { - Condition = condition; - Value = value; + Key1 = key1; + Key2 = key2; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// When to check if an asset is expired. - public AutoDeleteCondition? Condition { get; set; } - /// Expiration condition value. - public string Value { get; set; } + /// Gets the key 1. + public string Key1 { get; } + /// Gets the key 2. + public string Key2 { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs new file mode 100644 index 0000000000000..a0ec034812f77 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AccountKeyAuthTypeWorkspaceConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountKeyAuthTypeWorkspaceConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + + internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WorkspaceConnectionAccountKey credentials = default; + MachineLearningConnectionAuthType authType = default; + MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = WorkspaceConnectionAccountKey.DeserializeWorkspaceConnectionAccountKey(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new MachineLearningConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new MachineLearningConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountKeyAuthTypeWorkspaceConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AccountKeyAuthTypeWorkspaceConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountKeyAuthTypeWorkspaceConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs new file mode 100644 index 0000000000000..112aa7fecd584 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// This connection type covers the account key connection for Azure storage. + public partial class AccountKeyAuthTypeWorkspaceConnectionProperties : MachineLearningWorkspaceConnectionProperties + { + /// Initializes a new instance of . + public AccountKeyAuthTypeWorkspaceConnectionProperties() + { + AuthType = MachineLearningConnectionAuthType.AccountKey; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Account key object for workspace connection credential. + internal AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccountKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Account key object for workspace connection credential. + internal WorkspaceConnectionAccountKey Credentials { get; set; } + /// Gets or sets the credentials key. + public string CredentialsKey + { + get => Credentials is null ? default : Credentials.Key; + set + { + if (Credentials is null) + Credentials = new WorkspaceConnectionAccountKey(); + Credentials.Key = value; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs new file mode 100644 index 0000000000000..198e01da20db7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Level at which content is filtered. + public readonly partial struct AllowedContentLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AllowedContentLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowValue = "Low"; + private const string MediumValue = "Medium"; + private const string HighValue = "High"; + + /// Low. + public static AllowedContentLevel Low { get; } = new AllowedContentLevel(LowValue); + /// Medium. + public static AllowedContentLevel Medium { get; } = new AllowedContentLevel(MediumValue); + /// High. + public static AllowedContentLevel High { get; } = new AllowedContentLevel(HighValue); + /// Determines if two values are the same. + public static bool operator ==(AllowedContentLevel left, AllowedContentLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AllowedContentLevel left, AllowedContentLevel right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AllowedContentLevel(string value) => new AllowedContentLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AllowedContentLevel other && Equals(other); + /// + public bool Equals(AllowedContentLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs index 10f2992e63d92..96c37b9a6f124 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AmlTokenComputeIdentity.cs @@ -20,7 +20,7 @@ public AmlTokenComputeIdentity() } /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. internal AmlTokenComputeIdentity(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData) : base(computeIdentityType, serializedAdditionalRawData) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs new file mode 100644 index 0000000000000..9350d73c2fe37 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AnonymousAccessCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AnonymousAccessCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnonymousAccessCredential(document.RootElement, options); + } + + internal static AnonymousAccessCredential DeserializeAnonymousAccessCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReferenceCredentialType credentialType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentialType"u8)) + { + credentialType = new DataReferenceCredentialType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnonymousAccessCredential(credentialType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{options.Format}' format."); + } + } + + AnonymousAccessCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAnonymousAccessCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.cs new file mode 100644 index 0000000000000..f9d10cdb7fe7d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Access credential with no credentials. + public partial class AnonymousAccessCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal AnonymousAccessCredential() + { + CredentialType = DataReferenceCredentialType.NoCredentials; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + internal AnonymousAccessCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData) : base(credentialType, serializedAdditionalRawData) + { + CredentialType = credentialType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs index 1e901da2c0636..b7068ace607d1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor WorkspaceConnectionApiKey credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor return new ApiKeyAuthWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs index be28e7c1bf475..4f69eac4a31b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -43,12 +44,20 @@ public ApiKeyAuthWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// Api key object for workspace connection credential. - internal ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionApiKey credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionApiKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs deleted file mode 100644 index 141f335a29614..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteCondition.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The AutoDeleteCondition. - public readonly partial struct AutoDeleteCondition : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutoDeleteCondition(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CreatedGreaterThanValue = "CreatedGreaterThan"; - private const string LastAccessedGreaterThanValue = "LastAccessedGreaterThan"; - - /// CreatedGreaterThan. - public static AutoDeleteCondition CreatedGreaterThan { get; } = new AutoDeleteCondition(CreatedGreaterThanValue); - /// LastAccessedGreaterThan. - public static AutoDeleteCondition LastAccessedGreaterThan { get; } = new AutoDeleteCondition(LastAccessedGreaterThanValue); - /// Determines if two values are the same. - public static bool operator ==(AutoDeleteCondition left, AutoDeleteCondition right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutoDeleteCondition left, AutoDeleteCondition right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutoDeleteCondition(string value) => new AutoDeleteCondition(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutoDeleteCondition other && Equals(other); - /// - public bool Equals(AutoDeleteCondition other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs index 2b01dd4816b68..5b388ec699c1f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs @@ -165,24 +165,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -306,7 +288,6 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -449,21 +430,6 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -547,7 +513,6 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, environmentId, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs index 4e9eaa9ccd7c5..eb048bcfbc038 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs @@ -53,7 +53,6 @@ public AutoMLJob(AutoMLVertical taskDetails) /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -76,7 +75,7 @@ public AutoMLJob(AutoMLVertical taskDetails) /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , and . /// - internal AutoMLJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, string environmentId, IDictionary environmentVariables, IDictionary outputs, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources, AutoMLVertical taskDetails) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal AutoMLJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, string environmentId, IDictionary environmentVariables, IDictionary outputs, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources, AutoMLVertical taskDetails) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { EnvironmentId = environmentId; EnvironmentVariables = environmentVariables; @@ -106,7 +105,19 @@ internal AutoMLJob() /// public IDictionary Outputs { get; set; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// Compute Resource configuration for the job. public MachineLearningJobResourceConfiguration Resources { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs index aa22e4716acf7..565c40c815909 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs @@ -72,18 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -108,35 +96,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteNull("nCrossValidations"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(TestData)) { if (TestData != null) @@ -260,11 +219,8 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso RegressionTrainingSettings trainingSettings = default; IList cvSplitColumnNames = default; TableVerticalFeaturizationSettings featurizationSettings = default; - TableFixedParameters fixedParameters = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; - IList searchSpace = default; - TableSweepSettings sweepSettings = default; MachineLearningTableJobInput testData = default; double? testDataSize = default; MachineLearningTableJobInput validationData = default; @@ -322,16 +278,6 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = TableFixedParameters.DeserializeTableFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -352,31 +298,6 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TableParameterSubspace.DeserializeTableParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = TableSweepSettings.DeserializeTableSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("testData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -472,11 +393,8 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso trainingSettings, cvSplitColumnNames ?? new ChangeTrackingList(), featurizationSettings, - fixedParameters, limitSettings, nCrossValidations, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, testData, testDataSize, validationData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs index 15a8942eec1ae..0dbc63809cd91 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs @@ -21,7 +21,6 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas Argument.AssertNotNull(trainingData, nameof(trainingData)); CvSplitColumnNames = new ChangeTrackingList(); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.Regression; } @@ -38,7 +37,6 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Inputs for training phase for an AutoML Job. /// Columns to use for CVSplit data. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -46,8 +44,6 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Test data input. /// /// The fraction of test dataset that needs to be set aside for validation purpose. @@ -61,17 +57,14 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Applied when validation dataset is not provided. /// /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. - internal AutoMLVerticalRegression(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, AutoMLVerticalRegressionPrimaryMetric? primaryMetric, RegressionTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableFixedParameters fixedParameters, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList searchSpace, TableSweepSettings sweepSettings, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal AutoMLVerticalRegression(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, AutoMLVerticalRegressionPrimaryMetric? primaryMetric, RegressionTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; CvSplitColumnNames = cvSplitColumnNames; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; TestData = testData; TestDataSize = testDataSize; ValidationData = validationData; @@ -93,8 +86,6 @@ internal AutoMLVerticalRegression() public IList CvSplitColumnNames { get; set; } /// Featurization inputs needed for AutoML job. public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } - /// Model/training parameters that will remain constant throughout training. - public TableFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -104,10 +95,6 @@ internal AutoMLVerticalRegression() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public TableSweepSettings SweepSettings { get; set; } /// Test data input. public MachineLearningTableJobInput TestData { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs index 7788e7a8a1f11..aa5310e7985e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegressionModel.cs @@ -57,7 +57,7 @@ public AutoMLVerticalRegressionModel(string value) public static AutoMLVerticalRegressionModel SGD { get; } = new AutoMLVerticalRegressionModel(SGDValue); /// /// Random forest is a supervised learning algorithm. - /// The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging method. + /// The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” method. /// The general idea of the bagging method is that a combination of learning models increases the overall result. /// public static AutoMLVerticalRegressionModel RandomForest { get; } = new AutoMLVerticalRegressionModel(RandomForestValue); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs deleted file mode 100644 index 8f3984ae96eb3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class AzMonMonitoringAlertNotificationSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzMonMonitoringAlertNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzMonMonitoringAlertNotificationSettings(document.RootElement, options); - } - - internal static AzMonMonitoringAlertNotificationSettings DeserializeAzMonMonitoringAlertNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MonitoringAlertNotificationType alertNotificationType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("alertNotificationType"u8)) - { - alertNotificationType = new MonitoringAlertNotificationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzMonMonitoringAlertNotificationSettings(alertNotificationType, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support writing '{options.Format}' format."); - } - } - - AzMonMonitoringAlertNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzMonMonitoringAlertNotificationSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzMonMonitoringAlertNotificationSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs deleted file mode 100644 index f96f63f1c29ef..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzMonMonitoringAlertNotificationSettings.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The AzMonMonitoringAlertNotificationSettings. - public partial class AzMonMonitoringAlertNotificationSettings : MonitoringAlertNotificationSettingsBase - { - /// Initializes a new instance of . - public AzMonMonitoringAlertNotificationSettings() - { - AlertNotificationType = MonitoringAlertNotificationType.AzureMonitor; - } - - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - internal AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData) : base(alertNotificationType, serializedAdditionalRawData) - { - AlertNotificationType = alertNotificationType; - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs deleted file mode 100644 index c0f3d1e49ed8c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Azure ML batch inferencing server configurations. - public partial class AzureMLBatchInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public AzureMLBatchInferencingServer() - { - ServerType = InferencingServerType.AzureMLBatch; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Code configuration for AML batch inferencing server. - internal AzureMLBatchInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, MachineLearningCodeConfiguration codeConfiguration) : base(serverType, serializedAdditionalRawData) - { - CodeConfiguration = codeConfiguration; - ServerType = serverType; - } - - /// Code configuration for AML batch inferencing server. - public MachineLearningCodeConfiguration CodeConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs deleted file mode 100644 index 0015f874a6bc2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Azure ML online inferencing configurations. - public partial class AzureMLOnlineInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public AzureMLOnlineInferencingServer() - { - ServerType = InferencingServerType.AzureMLOnline; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Code configuration for AML inferencing server. - internal AzureMLOnlineInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, MachineLearningCodeConfiguration codeConfiguration) : base(serverType, serializedAdditionalRawData) - { - CodeConfiguration = codeConfiguration; - ServerType = serverType; - } - - /// Code configuration for AML inferencing server. - public MachineLearningCodeConfiguration CodeConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs new file mode 100644 index 0000000000000..bba503c1bbb18 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AzureOpenAiFineTuning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HyperParameters)) + { + if (HyperParameters != null) + { + writer.WritePropertyName("hyperParameters"u8); + writer.WriteObjectValue(HyperParameters, options); + } + else + { + writer.WriteNull("hyperParameters"); + } + } + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOpenAiFineTuning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAiFineTuning(document.RootElement, options); + } + + internal static AzureOpenAiFineTuning DeserializeAzureOpenAiFineTuning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureOpenAiHyperParameters hyperParameters = default; + ModelProvider modelProvider = default; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + hyperParameters = null; + continue; + } + hyperParameters = AzureOpenAiHyperParameters.DeserializeAzureOpenAiHyperParameters(property.Value, options); + continue; + } + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAiFineTuning( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData, + hyperParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAiFineTuning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOpenAiFineTuning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs new file mode 100644 index 0000000000000..010bba8b688ab --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The AzureOpenAiFineTuning. + public partial class AzureOpenAiFineTuning : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// or is null. + public AzureOpenAiFineTuning(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) : base(taskType, trainingData, model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + ModelProvider = ModelProvider.AzureOpenAI; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + /// HyperParameters for fine tuning Azure Open AI model. + internal AzureOpenAiFineTuning(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData, AzureOpenAiHyperParameters hyperParameters) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + HyperParameters = hyperParameters; + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal AzureOpenAiFineTuning() + { + } + + /// HyperParameters for fine tuning Azure Open AI model. + public AzureOpenAiHyperParameters HyperParameters { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs new file mode 100644 index 0000000000000..17269dbe9ec47 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AzureOpenAiHyperParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(LearningRateMultiplier)) + { + if (LearningRateMultiplier != null) + { + writer.WritePropertyName("learningRateMultiplier"u8); + writer.WriteNumberValue(LearningRateMultiplier.Value); + } + else + { + writer.WriteNull("learningRateMultiplier"); + } + } + if (Optional.IsDefined(BatchSize)) + { + if (BatchSize != null) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + else + { + writer.WriteNull("batchSize"); + } + } + if (Optional.IsDefined(NEpochs)) + { + if (NEpochs != null) + { + writer.WritePropertyName("nEpochs"u8); + writer.WriteNumberValue(NEpochs.Value); + } + else + { + writer.WriteNull("nEpochs"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOpenAiHyperParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAiHyperParameters(document.RootElement, options); + } + + internal static AzureOpenAiHyperParameters DeserializeAzureOpenAiHyperParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? learningRateMultiplier = default; + int? batchSize = default; + int? nEpochs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("learningRateMultiplier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + learningRateMultiplier = null; + continue; + } + learningRateMultiplier = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + batchSize = null; + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nEpochs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + nEpochs = null; + continue; + } + nEpochs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAiHyperParameters(learningRateMultiplier, batchSize, nEpochs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAiHyperParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOpenAiHyperParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs new file mode 100644 index 0000000000000..e86aa76fc6be7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure Open AI hyperparameters for fine tuning. + public partial class AzureOpenAiHyperParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AzureOpenAiHyperParameters() + { + } + + /// Initializes a new instance of . + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + /// Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + /// Keeps track of any properties unknown to the library. + internal AzureOpenAiHyperParameters(double? learningRateMultiplier, int? batchSize, int? nEpochs, IDictionary serializedAdditionalRawData) + { + LearningRateMultiplier = learningRateMultiplier; + BatchSize = batchSize; + NEpochs = nEpochs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + public double? LearningRateMultiplier { get; set; } + /// Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + public int? BatchSize { get; set; } + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + public int? NEpochs { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs deleted file mode 100644 index a78b73d62c722..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.Serialization.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownBaseEnvironmentSource))] - public partial class BaseEnvironmentSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("baseEnvironmentSourceType"u8); - writer.WriteStringValue(BaseEnvironmentSourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - BaseEnvironmentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseEnvironmentSource(document.RootElement, options); - } - - internal static BaseEnvironmentSource DeserializeBaseEnvironmentSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("baseEnvironmentSourceType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "EnvironmentAsset": return BaseEnvironmentType.DeserializeBaseEnvironmentType(element, options); - } - } - return UnknownBaseEnvironmentSource.DeserializeUnknownBaseEnvironmentSource(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{options.Format}' format."); - } - } - - BaseEnvironmentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseEnvironmentSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs deleted file mode 100644 index a4569bd0bb2d9..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSource.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public abstract partial class BaseEnvironmentSource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected BaseEnvironmentSource() - { - } - - /// Initializes a new instance of . - /// [Required] Base environment type. - /// Keeps track of any properties unknown to the library. - internal BaseEnvironmentSource(BaseEnvironmentSourceType baseEnvironmentSourceType, IDictionary serializedAdditionalRawData) - { - BaseEnvironmentSourceType = baseEnvironmentSourceType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Base environment type. - internal BaseEnvironmentSourceType BaseEnvironmentSourceType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs deleted file mode 100644 index f87bd297d3e3e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentSourceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Base environment type. - internal readonly partial struct BaseEnvironmentSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public BaseEnvironmentSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnvironmentAssetValue = "EnvironmentAsset"; - - /// EnvironmentAsset. - public static BaseEnvironmentSourceType EnvironmentAsset { get; } = new BaseEnvironmentSourceType(EnvironmentAssetValue); - /// Determines if two values are the same. - public static bool operator ==(BaseEnvironmentSourceType left, BaseEnvironmentSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(BaseEnvironmentSourceType left, BaseEnvironmentSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator BaseEnvironmentSourceType(string value) => new BaseEnvironmentSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is BaseEnvironmentSourceType other && Equals(other); - /// - public bool Equals(BaseEnvironmentSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs deleted file mode 100644 index 16edb0ec928a5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class BaseEnvironmentType : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - writer.WritePropertyName("baseEnvironmentSourceType"u8); - writer.WriteStringValue(BaseEnvironmentSourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - BaseEnvironmentType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseEnvironmentType(document.RootElement, options); - } - - internal static BaseEnvironmentType DeserializeBaseEnvironmentType(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier resourceId = default; - BaseEnvironmentSourceType baseEnvironmentSourceType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("baseEnvironmentSourceType"u8)) - { - baseEnvironmentSourceType = new BaseEnvironmentSourceType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BaseEnvironmentType(baseEnvironmentSourceType, serializedAdditionalRawData, resourceId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support writing '{options.Format}' format."); - } - } - - BaseEnvironmentType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseEnvironmentType(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseEnvironmentType)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs deleted file mode 100644 index 334c4ebf008c3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/BaseEnvironmentType.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Base environment type. - public partial class BaseEnvironmentType : BaseEnvironmentSource - { - /// Initializes a new instance of . - /// [Required] Resource id accepting ArmId or AzureMlId. - /// is null. - public BaseEnvironmentType(ResourceIdentifier resourceId) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - ResourceId = resourceId; - BaseEnvironmentSourceType = BaseEnvironmentSourceType.EnvironmentAsset; - } - - /// Initializes a new instance of . - /// [Required] Base environment type. - /// Keeps track of any properties unknown to the library. - /// [Required] Resource id accepting ArmId or AzureMlId. - internal BaseEnvironmentType(BaseEnvironmentSourceType baseEnvironmentSourceType, IDictionary serializedAdditionalRawData, ResourceIdentifier resourceId) : base(baseEnvironmentSourceType, serializedAdditionalRawData) - { - ResourceId = resourceId; - BaseEnvironmentSourceType = baseEnvironmentSourceType; - } - - /// Initializes a new instance of for deserialization. - internal BaseEnvironmentType() - { - } - - /// [Required] Resource id accepting ArmId or AzureMlId. - public ResourceIdentifier ResourceId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs index 843a27caf9b53..5a569a531dd8b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModel.cs @@ -78,7 +78,7 @@ public ClassificationModel(string value) public static ClassificationModel DecisionTree { get; } = new ClassificationModel(DecisionTreeValue); /// /// Random forest is a supervised learning algorithm. - /// The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging method. + /// The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” method. /// The general idea of the bagging method is that a combination of learning models increases the overall result. /// public static ClassificationModel RandomForest { get; } = new ClassificationModel(RandomForestValue); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs deleted file mode 100644 index 46b681e987305..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetric.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The ClassificationModelPerformanceMetric. - public readonly partial struct ClassificationModelPerformanceMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ClassificationModelPerformanceMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AccuracyValue = "Accuracy"; - private const string PrecisionValue = "Precision"; - private const string RecallValue = "Recall"; - - /// Calculates the accuracy of the model predictions. - public static ClassificationModelPerformanceMetric Accuracy { get; } = new ClassificationModelPerformanceMetric(AccuracyValue); - /// Calculates the precision of the model predictions. - public static ClassificationModelPerformanceMetric Precision { get; } = new ClassificationModelPerformanceMetric(PrecisionValue); - /// Calculates the recall of the model predictions. - public static ClassificationModelPerformanceMetric Recall { get; } = new ClassificationModelPerformanceMetric(RecallValue); - /// Determines if two values are the same. - public static bool operator ==(ClassificationModelPerformanceMetric left, ClassificationModelPerformanceMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ClassificationModelPerformanceMetric left, ClassificationModelPerformanceMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ClassificationModelPerformanceMetric(string value) => new ClassificationModelPerformanceMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ClassificationModelPerformanceMetric other && Equals(other); - /// - public bool Equals(ClassificationModelPerformanceMetric other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs deleted file mode 100644 index 82ce87326fae2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.Serialization.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ClassificationModelPerformanceMetricThreshold : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ClassificationModelPerformanceMetricThreshold IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClassificationModelPerformanceMetricThreshold(document.RootElement, options); - } - - internal static ClassificationModelPerformanceMetricThreshold DeserializeClassificationModelPerformanceMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ClassificationModelPerformanceMetric metric = default; - MonitoringModelType modelType = default; - MonitoringThreshold threshold = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metric"u8)) - { - metric = new ClassificationModelPerformanceMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - threshold = null; - continue; - } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ClassificationModelPerformanceMetricThreshold(modelType, threshold, serializedAdditionalRawData, metric); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support writing '{options.Format}' format."); - } - } - - ClassificationModelPerformanceMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeClassificationModelPerformanceMetricThreshold(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ClassificationModelPerformanceMetricThreshold)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs deleted file mode 100644 index 911371099c1e2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationModelPerformanceMetricThreshold.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The ClassificationModelPerformanceMetricThreshold. - public partial class ClassificationModelPerformanceMetricThreshold : ModelPerformanceMetricThresholdBase - { - /// Initializes a new instance of . - /// [Required] The classification model performance to calculate. - public ClassificationModelPerformanceMetricThreshold(ClassificationModelPerformanceMetric metric) - { - Metric = metric; - ModelType = MonitoringModelType.Classification; - } - - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - /// [Required] The classification model performance to calculate. - internal ClassificationModelPerformanceMetricThreshold(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData, ClassificationModelPerformanceMetric metric) : base(modelType, threshold, serializedAdditionalRawData) - { - Metric = metric; - ModelType = modelType; - } - - /// Initializes a new instance of for deserialization. - internal ClassificationModelPerformanceMetricThreshold() - { - } - - /// [Required] The classification model performance to calculate. - public ClassificationModelPerformanceMetric Metric { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs index 822c4b50339d3..0acf1eda328a3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs @@ -84,18 +84,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -120,35 +108,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("nCrossValidations"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(TestData)) { if (TestData != null) @@ -273,11 +232,8 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele ClassificationTrainingSettings trainingSettings = default; IList cvSplitColumnNames = default; TableVerticalFeaturizationSettings featurizationSettings = default; - TableFixedParameters fixedParameters = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; - IList searchSpace = default; - TableSweepSettings sweepSettings = default; MachineLearningTableJobInput testData = default; double? testDataSize = default; MachineLearningTableJobInput validationData = default; @@ -345,16 +301,6 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = TableFixedParameters.DeserializeTableFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -375,31 +321,6 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TableParameterSubspace.DeserializeTableParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = TableSweepSettings.DeserializeTableSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("testData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -496,11 +417,8 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele trainingSettings, cvSplitColumnNames ?? new ChangeTrackingList(), featurizationSettings, - fixedParameters, limitSettings, nCrossValidations, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, testData, testDataSize, validationData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs index 99051a32fd6bd..73f6d2ce3538e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs @@ -21,7 +21,6 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai Argument.AssertNotNull(trainingData, nameof(trainingData)); CvSplitColumnNames = new ChangeTrackingList(); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.Classification; } @@ -39,7 +38,6 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Inputs for training phase for an AutoML Job. /// Columns to use for CVSplit data. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -47,8 +45,6 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Test data input. /// /// The fraction of test dataset that needs to be set aside for validation purpose. @@ -62,18 +58,15 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Applied when validation dataset is not provided. /// /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. - internal ClassificationTask(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, string positiveLabel, ClassificationPrimaryMetric? primaryMetric, ClassificationTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableFixedParameters fixedParameters, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList searchSpace, TableSweepSettings sweepSettings, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal ClassificationTask(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, string positiveLabel, ClassificationPrimaryMetric? primaryMetric, ClassificationTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PositiveLabel = positiveLabel; PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; CvSplitColumnNames = cvSplitColumnNames; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; TestData = testData; TestDataSize = testDataSize; ValidationData = validationData; @@ -97,8 +90,6 @@ internal ClassificationTask() public IList CvSplitColumnNames { get; set; } /// Featurization inputs needed for AutoML job. public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } - /// Model/training parameters that will remain constant throughout training. - public TableFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -108,10 +99,6 @@ internal ClassificationTask() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public TableSweepSettings SweepSettings { get; set; } /// Test data input. public MachineLearningTableJobInput TestData { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs index 5c999009fc225..c6958af3f6a0f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs @@ -102,11 +102,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -154,7 +149,6 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -253,15 +247,6 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -276,7 +261,6 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs index c638f2edd997b..a0646519ae840 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs @@ -31,15 +31,10 @@ public ClassificationTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. /// Allowed models for classification task. /// Blocked models for classification task. - internal ClassificationTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, trainingMode, serializedAdditionalRawData) + internal ClassificationTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs deleted file mode 100644 index 9c99f438f1606..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class CocoExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ContainerName)) - { - if (ContainerName != null) - { - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - } - else - { - writer.WriteNull("containerName"); - } - } - if (options.Format != "W" && Optional.IsDefined(SnapshotPath)) - { - if (SnapshotPath != null) - { - writer.WritePropertyName("snapshotPath"u8); - writer.WriteStringValue(SnapshotPath); - } - else - { - writer.WriteNull("snapshotPath"); - } - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CocoExportSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCocoExportSummary(document.RootElement, options); - } - - internal static CocoExportSummary DeserializeCocoExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - string snapshotPath = default; - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = default; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - containerName = null; - continue; - } - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("snapshotPath"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - snapshotPath = null; - continue; - } - snapshotPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CocoExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData, - containerName, - snapshotPath); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support writing '{options.Format}' format."); - } - } - - CocoExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCocoExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CocoExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs deleted file mode 100644 index f02cada066e9f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CocoExportSummary.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The CocoExportSummary. - public partial class CocoExportSummary : ExportSummary - { - /// Initializes a new instance of . - public CocoExportSummary() - { - Format = ExportFormatType.Coco; - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - internal CocoExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData, string containerName, string snapshotPath) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - ContainerName = containerName; - SnapshotPath = snapshotPath; - Format = format; - } - - /// The container name to which the labels will be exported. - public string ContainerName { get; } - /// The output path where the labels will be exported. - public string SnapshotPath { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.cs new file mode 100644 index 0000000000000..cd5034bc606e3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceFrequency.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to describe the frequency of a compute recurrence schedule. + public readonly partial struct ComputeRecurrenceFrequency : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeRecurrenceFrequency(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MinuteValue = "Minute"; + private const string HourValue = "Hour"; + private const string DayValue = "Day"; + private const string WeekValue = "Week"; + private const string MonthValue = "Month"; + + /// Minute frequency. + public static ComputeRecurrenceFrequency Minute { get; } = new ComputeRecurrenceFrequency(MinuteValue); + /// Hour frequency. + public static ComputeRecurrenceFrequency Hour { get; } = new ComputeRecurrenceFrequency(HourValue); + /// Day frequency. + public static ComputeRecurrenceFrequency Day { get; } = new ComputeRecurrenceFrequency(DayValue); + /// Week frequency. + public static ComputeRecurrenceFrequency Week { get; } = new ComputeRecurrenceFrequency(WeekValue); + /// Month frequency. + public static ComputeRecurrenceFrequency Month { get; } = new ComputeRecurrenceFrequency(MonthValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeRecurrenceFrequency left, ComputeRecurrenceFrequency right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeRecurrenceFrequency left, ComputeRecurrenceFrequency right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeRecurrenceFrequency(string value) => new ComputeRecurrenceFrequency(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeRecurrenceFrequency other && Equals(other); + /// + public bool Equals(ComputeRecurrenceFrequency other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.Serialization.cs new file mode 100644 index 0000000000000..35546bb5ce259 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ComputeRecurrenceSchedule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("hours"u8); + writer.WriteStartArray(); + foreach (var item in Hours) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("minutes"u8); + writer.WriteStartArray(); + foreach (var item in Minutes) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(MonthDays)) + { + if (MonthDays != null) + { + writer.WritePropertyName("monthDays"u8); + writer.WriteStartArray(); + foreach (var item in MonthDays) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("monthDays"); + } + } + if (Optional.IsCollectionDefined(WeekDays)) + { + if (WeekDays != null) + { + writer.WritePropertyName("weekDays"u8); + writer.WriteStartArray(); + foreach (var item in WeekDays) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("weekDays"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeRecurrenceSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeRecurrenceSchedule(document.RootElement, options); + } + + internal static ComputeRecurrenceSchedule DeserializeComputeRecurrenceSchedule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList hours = default; + IList minutes = default; + IList monthDays = default; + IList weekDays = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hours"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + hours = array; + continue; + } + if (property.NameEquals("minutes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + minutes = array; + continue; + } + if (property.NameEquals("monthDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + monthDays = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + monthDays = array; + continue; + } + if (property.NameEquals("weekDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + weekDays = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ComputeWeekDay(item.GetString())); + } + weekDays = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeRecurrenceSchedule(hours, minutes, monthDays ?? new ChangeTrackingList(), weekDays ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support writing '{options.Format}' format."); + } + } + + ComputeRecurrenceSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeRecurrenceSchedule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeRecurrenceSchedule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.cs new file mode 100644 index 0000000000000..704a3dfcca345 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeRecurrenceSchedule.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ComputeRecurrenceSchedule. + public partial class ComputeRecurrenceSchedule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] List of hours for the schedule. + /// [Required] List of minutes for the schedule. + /// or is null. + public ComputeRecurrenceSchedule(IEnumerable hours, IEnumerable minutes) + { + Argument.AssertNotNull(hours, nameof(hours)); + Argument.AssertNotNull(minutes, nameof(minutes)); + + Hours = hours.ToList(); + Minutes = minutes.ToList(); + MonthDays = new ChangeTrackingList(); + WeekDays = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// [Required] List of hours for the schedule. + /// [Required] List of minutes for the schedule. + /// List of month days for the schedule. + /// List of days for the schedule. + /// Keeps track of any properties unknown to the library. + internal ComputeRecurrenceSchedule(IList hours, IList minutes, IList monthDays, IList weekDays, IDictionary serializedAdditionalRawData) + { + Hours = hours; + Minutes = minutes; + MonthDays = monthDays; + WeekDays = weekDays; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeRecurrenceSchedule() + { + } + + /// [Required] List of hours for the schedule. + public IList Hours { get; } + /// [Required] List of minutes for the schedule. + public IList Minutes { get; } + /// List of month days for the schedule. + public IList MonthDays { get; set; } + /// List of days for the schedule. + public IList WeekDays { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs index 76bd0cc08a359..1e21beef50843 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.Serialization.cs @@ -96,11 +96,11 @@ internal static ComputeStartStopRecurrenceSchedule DeserializeComputeStartStopRe { return null; } - MachineLearningRecurrenceFrequency? frequency = default; + ComputeRecurrenceFrequency? frequency = default; int? interval = default; string startTime = default; string timeZone = default; - MachineLearningRecurrenceSchedule schedule = default; + ComputeRecurrenceSchedule schedule = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -111,7 +111,7 @@ internal static ComputeStartStopRecurrenceSchedule DeserializeComputeStartStopRe { continue; } - frequency = new MachineLearningRecurrenceFrequency(property.Value.GetString()); + frequency = new ComputeRecurrenceFrequency(property.Value.GetString()); continue; } if (property.NameEquals("interval"u8)) @@ -144,7 +144,7 @@ internal static ComputeStartStopRecurrenceSchedule DeserializeComputeStartStopRe { continue; } - schedule = MachineLearningRecurrenceSchedule.DeserializeMachineLearningRecurrenceSchedule(property.Value, options); + schedule = ComputeRecurrenceSchedule.DeserializeComputeRecurrenceSchedule(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs index 2daa6fd1180c2..d06404c620d9e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeStartStopRecurrenceSchedule.cs @@ -60,7 +60,7 @@ public ComputeStartStopRecurrenceSchedule() /// /// [Required] The recurrence schedule. /// Keeps track of any properties unknown to the library. - internal ComputeStartStopRecurrenceSchedule(MachineLearningRecurrenceFrequency? frequency, int? interval, string startTime, string timeZone, MachineLearningRecurrenceSchedule schedule, IDictionary serializedAdditionalRawData) + internal ComputeStartStopRecurrenceSchedule(ComputeRecurrenceFrequency? frequency, int? interval, string startTime, string timeZone, ComputeRecurrenceSchedule schedule, IDictionary serializedAdditionalRawData) { Frequency = frequency; Interval = interval; @@ -71,7 +71,7 @@ internal ComputeStartStopRecurrenceSchedule(MachineLearningRecurrenceFrequency? } /// [Required] The frequency to trigger schedule. - public MachineLearningRecurrenceFrequency? Frequency { get; set; } + public ComputeRecurrenceFrequency? Frequency { get; set; } /// [Required] Specifies schedule interval in conjunction with frequency. public int? Interval { get; set; } /// The start time in yyyy-MM-ddTHH:mm:ss format. @@ -82,6 +82,6 @@ internal ComputeStartStopRecurrenceSchedule(MachineLearningRecurrenceFrequency? /// public string TimeZone { get; set; } /// [Required] The recurrence schedule. - public MachineLearningRecurrenceSchedule Schedule { get; set; } + public ComputeRecurrenceSchedule Schedule { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeTriggerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeTriggerType.cs new file mode 100644 index 0000000000000..a90880e17a1bb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeTriggerType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ComputeTriggerType. + public readonly partial struct ComputeTriggerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeTriggerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RecurrenceValue = "Recurrence"; + private const string CronValue = "Cron"; + + /// Recurrence. + public static ComputeTriggerType Recurrence { get; } = new ComputeTriggerType(RecurrenceValue); + /// Cron. + public static ComputeTriggerType Cron { get; } = new ComputeTriggerType(CronValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeTriggerType left, ComputeTriggerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeTriggerType left, ComputeTriggerType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeTriggerType(string value) => new ComputeTriggerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeTriggerType other && Equals(other); + /// + public bool Equals(ComputeTriggerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.cs new file mode 100644 index 0000000000000..eb1d5f38d2dc2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ComputeWeekDay.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Enum of weekday. + public readonly partial struct ComputeWeekDay : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeWeekDay(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MondayValue = "Monday"; + private const string TuesdayValue = "Tuesday"; + private const string WednesdayValue = "Wednesday"; + private const string ThursdayValue = "Thursday"; + private const string FridayValue = "Friday"; + private const string SaturdayValue = "Saturday"; + private const string SundayValue = "Sunday"; + + /// Monday weekday. + public static ComputeWeekDay Monday { get; } = new ComputeWeekDay(MondayValue); + /// Tuesday weekday. + public static ComputeWeekDay Tuesday { get; } = new ComputeWeekDay(TuesdayValue); + /// Wednesday weekday. + public static ComputeWeekDay Wednesday { get; } = new ComputeWeekDay(WednesdayValue); + /// Thursday weekday. + public static ComputeWeekDay Thursday { get; } = new ComputeWeekDay(ThursdayValue); + /// Friday weekday. + public static ComputeWeekDay Friday { get; } = new ComputeWeekDay(FridayValue); + /// Saturday weekday. + public static ComputeWeekDay Saturday { get; } = new ComputeWeekDay(SaturdayValue); + /// Sunday weekday. + public static ComputeWeekDay Sunday { get; } = new ComputeWeekDay(SundayValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeWeekDay left, ComputeWeekDay right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeWeekDay left, ComputeWeekDay right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeWeekDay(string value) => new ComputeWeekDay(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeWeekDay other && Equals(other); + /// + public bool Equals(ComputeWeekDay other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.cs new file mode 100644 index 0000000000000..74692bb3b9166 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ConnectionGroup.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Group based on connection category. + public readonly partial struct ConnectionGroup : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectionGroup(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureValue = "Azure"; + private const string AzureAIValue = "AzureAI"; + private const string DatabaseValue = "Database"; + private const string NoSQLValue = "NoSQL"; + private const string FileValue = "File"; + private const string GenericProtocolValue = "GenericProtocol"; + private const string ServicesAndAppsValue = "ServicesAndApps"; + + /// Azure. + public static ConnectionGroup Azure { get; } = new ConnectionGroup(AzureValue); + /// AzureAI. + public static ConnectionGroup AzureAI { get; } = new ConnectionGroup(AzureAIValue); + /// Database. + public static ConnectionGroup Database { get; } = new ConnectionGroup(DatabaseValue); + /// NoSQL. + public static ConnectionGroup NoSQL { get; } = new ConnectionGroup(NoSQLValue); + /// File. + public static ConnectionGroup File { get; } = new ConnectionGroup(FileValue); + /// GenericProtocol. + public static ConnectionGroup GenericProtocol { get; } = new ConnectionGroup(GenericProtocolValue); + /// ServicesAndApps. + public static ConnectionGroup ServicesAndApps { get; } = new ConnectionGroup(ServicesAndAppsValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionGroup left, ConnectionGroup right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionGroup left, ConnectionGroup right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConnectionGroup(string value) => new ConnectionGroup(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionGroup other && Equals(other); + /// + public bool Equals(ConnectionGroup other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.Serialization.cs index 28dc671c88ad5..5efea0b7e8274 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.Serialization.cs @@ -13,21 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownInferencingServer : IUtf8JsonSerializable, IJsonModel + internal partial class ContentSafety : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); + writer.WritePropertyName("contentSafetyStatus"u8); + writer.WriteStringValue(ContentSafetyStatus.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - InferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentSafety IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInferencingServer(document.RootElement, options); + return DeserializeContentSafety(document.RootElement, options); } - internal static UnknownInferencingServer DeserializeUnknownInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentSafety DeserializeContentSafety(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +66,14 @@ internal static UnknownInferencingServer DeserializeUnknownInferencingServer(Jso { return null; } - InferencingServerType serverType = "Unknown"; + ContentSafetyStatus contentSafetyStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("serverType"u8)) + if (property.NameEquals("contentSafetyStatus"u8)) { - serverType = new InferencingServerType(property.Value.GetString()); + contentSafetyStatus = new ContentSafetyStatus(property.Value.GetString()); continue; } if (options.Format != "W") @@ -82,38 +82,38 @@ internal static UnknownInferencingServer DeserializeUnknownInferencingServer(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownInferencingServer(serverType, serializedAdditionalRawData); + return new ContentSafety(contentSafetyStatus, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support writing '{options.Format}' format."); } } - InferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContentSafety IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInferencingServer(document.RootElement, options); + return DeserializeContentSafety(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentSafety)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs new file mode 100644 index 0000000000000..8d2c748d01e82 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafety.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafety. + internal partial class ContentSafety + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] Specifies the status of content safety. + public ContentSafety(ContentSafetyStatus contentSafetyStatus) + { + ContentSafetyStatus = contentSafetyStatus; + } + + /// Initializes a new instance of . + /// [Required] Specifies the status of content safety. + /// Keeps track of any properties unknown to the library. + internal ContentSafety(ContentSafetyStatus contentSafetyStatus, IDictionary serializedAdditionalRawData) + { + ContentSafetyStatus = contentSafetyStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContentSafety() + { + } + + /// [Required] Specifies the status of content safety. + public ContentSafetyStatus ContentSafetyStatus { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..1f9a6b636ae59 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ContentSafetyEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContentSafetyEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentSafetyEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static ContentSafetyEndpointDeploymentResourceProperties DeserializeContentSafetyEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentSafetyEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContentSafetyEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentSafetyEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..46d2ac213c276 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafetyEndpointDeploymentResourceProperties. + public partial class ContentSafetyEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.ContentSafety"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal ContentSafetyEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.ContentSafety"; + } + + /// Initializes a new instance of for deserialization. + internal ContentSafetyEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..ff216c2c4849c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ContentSafetyEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContentSafetyEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentSafetyEndpointResourceProperties(document.RootElement, options); + } + + internal static ContentSafetyEndpointResourceProperties DeserializeContentSafetyEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentSafetyEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContentSafetyEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentSafetyEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs new file mode 100644 index 0000000000000..cd968320a7661 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafetyEndpointResourceProperties. + public partial class ContentSafetyEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ContentSafetyEndpointResourceProperties() + { + EndpointType = EndpointType.AzureContentSafety; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal ContentSafetyEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs new file mode 100644 index 0000000000000..200ff6eea22d6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Specifies the status of content safety. + public readonly partial struct ContentSafetyStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContentSafetyStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static ContentSafetyStatus Enabled { get; } = new ContentSafetyStatus(EnabledValue); + /// Disabled. + public static ContentSafetyStatus Disabled { get; } = new ContentSafetyStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ContentSafetyStatus left, ContentSafetyStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContentSafetyStatus left, ContentSafetyStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContentSafetyStatus(string value) => new ContentSafetyStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContentSafetyStatus other && Equals(other); + /// + public bool Equals(ContentSafetyStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs index 132623c2a375c..77b6bb13f48a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CredentialsType.cs @@ -27,8 +27,6 @@ public CredentialsType(string value) private const string NoneValue = "None"; private const string SasValue = "Sas"; private const string ServicePrincipalValue = "ServicePrincipal"; - private const string KerberosKeytabValue = "KerberosKeytab"; - private const string KerberosPasswordValue = "KerberosPassword"; /// AccountKey. public static CredentialsType AccountKey { get; } = new CredentialsType(AccountKeyValue); @@ -40,10 +38,6 @@ public CredentialsType(string value) public static CredentialsType Sas { get; } = new CredentialsType(SasValue); /// ServicePrincipal. public static CredentialsType ServicePrincipal { get; } = new CredentialsType(ServicePrincipalValue); - /// KerberosKeytab. - public static CredentialsType KerberosKeytab { get; } = new CredentialsType(KerberosKeytabValue); - /// KerberosPassword. - public static CredentialsType KerberosPassword { get; } = new CredentialsType(KerberosPasswordValue); /// Determines if two values are the same. public static bool operator ==(CredentialsType left, CredentialsType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs deleted file mode 100644 index bb814d15b773b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class CsvExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ContainerName)) - { - if (ContainerName != null) - { - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - } - else - { - writer.WriteNull("containerName"); - } - } - if (options.Format != "W" && Optional.IsDefined(SnapshotPath)) - { - if (SnapshotPath != null) - { - writer.WritePropertyName("snapshotPath"u8); - writer.WriteStringValue(SnapshotPath); - } - else - { - writer.WriteNull("snapshotPath"); - } - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CsvExportSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCsvExportSummary(document.RootElement, options); - } - - internal static CsvExportSummary DeserializeCsvExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - string snapshotPath = default; - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = default; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - containerName = null; - continue; - } - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("snapshotPath"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - snapshotPath = null; - continue; - } - snapshotPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CsvExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData, - containerName, - snapshotPath); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support writing '{options.Format}' format."); - } - } - - CsvExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCsvExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CsvExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs deleted file mode 100644 index 5b478f5388eed..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CsvExportSummary.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The CsvExportSummary. - public partial class CsvExportSummary : ExportSummary - { - /// Initializes a new instance of . - public CsvExportSummary() - { - Format = ExportFormatType.CSV; - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - /// The container name to which the labels will be exported. - /// The output path where the labels will be exported. - internal CsvExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData, string containerName, string snapshotPath) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - ContainerName = containerName; - SnapshotPath = snapshotPath; - Format = format; - } - - /// The container name to which the labels will be exported. - public string ContainerName { get; } - /// The output path where the labels will be exported. - public string SnapshotPath { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs deleted file mode 100644 index 142d98b3fb45c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Custom inference server configurations. - public partial class CustomInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public CustomInferencingServer() - { - ServerType = InferencingServerType.Custom; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Inference configuration for custom inferencing. - internal CustomInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, OnlineInferenceConfiguration inferenceConfiguration) : base(serverType, serializedAdditionalRawData) - { - InferenceConfiguration = inferenceConfiguration; - ServerType = serverType; - } - - /// Inference configuration for custom inferencing. - public OnlineInferenceConfiguration InferenceConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs index 4a7186181490b..79cf83cbcc789 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor CustomKeys credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor return new CustomKeysWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs index b6dfcb621047a..421b83411cc22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -28,12 +29,20 @@ public CustomKeysWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// Custom Keys credential object. - internal CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs new file mode 100644 index 0000000000000..f5ce08ae51bba --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class CustomModelFineTuning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(HyperParameters)) + { + if (HyperParameters != null) + { + writer.WritePropertyName("hyperParameters"u8); + writer.WriteStartObject(); + foreach (var item in HyperParameters) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("hyperParameters"); + } + } + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomModelFineTuning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomModelFineTuning(document.RootElement, options); + } + + internal static CustomModelFineTuning DeserializeCustomModelFineTuning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary hyperParameters = default; + ModelProvider modelProvider = default; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + hyperParameters = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + hyperParameters = dictionary; + continue; + } + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomModelFineTuning( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData, + hyperParameters ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support writing '{options.Format}' format."); + } + } + + CustomModelFineTuning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomModelFineTuning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs new file mode 100644 index 0000000000000..2431930ea9bcc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The CustomModelFineTuning. + public partial class CustomModelFineTuning : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// or is null. + public CustomModelFineTuning(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) : base(taskType, trainingData, model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + HyperParameters = new ChangeTrackingDictionary(); + ModelProvider = ModelProvider.Custom; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + /// HyperParameters for fine tuning custom model. + internal CustomModelFineTuning(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData, IDictionary hyperParameters) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + HyperParameters = hyperParameters; + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal CustomModelFineTuning() + { + } + + /// HyperParameters for fine tuning custom model. + public IDictionary HyperParameters { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs index 922b3892d5328..45a4cf658a3be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs @@ -71,12 +71,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("workspaceConnection"u8); - writer.WriteObjectValue(WorkspaceConnection, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -140,8 +150,7 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle IDictionary inputAssets = default; IDictionary inputs = default; IList metricThresholds = default; - MonitoringWorkspaceConnection workspaceConnection = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; @@ -193,18 +202,19 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle metricThresholds = array; continue; } - if (property.NameEquals("workspaceConnection"u8)) - { - workspaceConnection = MonitoringWorkspaceConnection.DeserializeMonitoringWorkspaceConnection(property.Value, options); - continue; - } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -234,15 +244,14 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle } serializedAdditionalRawData = rawDataDictionary; return new CustomMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, componentId, inputAssets ?? new ChangeTrackingDictionary(), inputs ?? new ChangeTrackingDictionary(), - metricThresholds, - workspaceConnection); + metricThresholds); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs index ee4d23f2ca111..426203fea1080 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs @@ -15,34 +15,31 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class CustomMonitoringSignal : MonitoringSignalBase { /// Initializes a new instance of . - /// [Required] ARM resource ID of the component resource used to calculate the custom metrics. + /// [Required] Reference to the component asset used to calculate the custom metrics. /// [Required] A list of metrics to calculate and their associated thresholds. - /// [Required] A list of metrics to calculate and their associated thresholds. - /// , or is null. - public CustomMonitoringSignal(string componentId, IEnumerable metricThresholds, MonitoringWorkspaceConnection workspaceConnection) + /// or is null. + public CustomMonitoringSignal(string componentId, IEnumerable metricThresholds) { Argument.AssertNotNull(componentId, nameof(componentId)); Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); - Argument.AssertNotNull(workspaceConnection, nameof(workspaceConnection)); ComponentId = componentId; InputAssets = new ChangeTrackingDictionary(); Inputs = new ChangeTrackingDictionary(); MetricThresholds = metricThresholds.ToList(); - WorkspaceConnection = workspaceConnection; SignalType = MonitoringSignalType.Custom; } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - /// [Required] ARM resource ID of the component resource used to calculate the custom metrics. + /// [Required] Reference to the component asset used to calculate the custom metrics. /// /// Monitoring assets to take as input. Key is the component input port name, value is the data asset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// Extra component parameters to take as input. Key is the component literal input port name, value is the parameter value. @@ -50,14 +47,12 @@ public CustomMonitoringSignal(string componentId, IEnumerable, , , , , and . /// /// [Required] A list of metrics to calculate and their associated thresholds. - /// [Required] A list of metrics to calculate and their associated thresholds. - internal CustomMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, string componentId, IDictionary inputAssets, IDictionary inputs, IList metricThresholds, MonitoringWorkspaceConnection workspaceConnection) : base(mode, properties, signalType, serializedAdditionalRawData) + internal CustomMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, string componentId, IDictionary inputAssets, IDictionary inputs, IList metricThresholds) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { ComponentId = componentId; InputAssets = inputAssets; Inputs = inputs; MetricThresholds = metricThresholds; - WorkspaceConnection = workspaceConnection; SignalType = signalType; } @@ -66,12 +61,12 @@ internal CustomMonitoringSignal() { } - /// [Required] ARM resource ID of the component resource used to calculate the custom metrics. + /// [Required] Reference to the component asset used to calculate the custom metrics. public string ComponentId { get; set; } /// /// Monitoring assets to take as input. Key is the component input port name, value is the data asset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public IDictionary InputAssets { get; set; } /// @@ -82,7 +77,5 @@ internal CustomMonitoringSignal() public IDictionary Inputs { get; set; } /// [Required] A list of metrics to calculate and their associated thresholds. public IList MetricThresholds { get; } - /// [Required] A list of metrics to calculate and their associated thresholds. - public MonitoringWorkspaceConnection WorkspaceConnection { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs index b77ca56561b54..fff95ca8fb826 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs @@ -79,6 +79,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt } writer.WriteEndArray(); } + if (Optional.IsDefined(Kernel)) + { + writer.WritePropertyName("kernel"u8); + writer.WriteObjectValue(Kernel, options); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -120,6 +125,7 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode DockerSetting docker = default; IList endpoints = default; IList volumes = default; + JupyterKernelConfig kernel = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -190,6 +196,15 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode volumes = array; continue; } + if (property.NameEquals("kernel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kernel = JupyterKernelConfig.DeserializeJupyterKernelConfig(property.Value, options); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; @@ -200,6 +215,7 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode docker, endpoints ?? new ChangeTrackingList(), volumes ?? new ChangeTrackingList(), + kernel, additionalProperties); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs index f0396ea418bd3..79b4d17819364 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs @@ -29,8 +29,9 @@ public CustomService() /// Describes the docker settings for the image. /// Configuring the endpoints for the container. /// Configuring the volumes for the container. + /// Describes the jupyter kernel settings for the image if its a custom environment. /// Additional Properties. - internal CustomService(string name, ImageSetting image, IDictionary environmentVariables, DockerSetting docker, IList endpoints, IList volumes, IDictionary additionalProperties) + internal CustomService(string name, ImageSetting image, IDictionary environmentVariables, DockerSetting docker, IList endpoints, IList volumes, JupyterKernelConfig kernel, IDictionary additionalProperties) { Name = name; Image = image; @@ -38,6 +39,7 @@ internal CustomService(string name, ImageSetting image, IDictionary Endpoints { get; } /// Configuring the volumes for the container. public IList Volumes { get; } + /// Describes the jupyter kernel settings for the image if its a custom environment. + public JupyterKernelConfig Kernel { get; set; } /// /// Additional Properties /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.cs new file mode 100644 index 0000000000000..5494b42eb341a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataAvailabilityStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The DataAvailabilityStatus. + public readonly partial struct DataAvailabilityStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataAvailabilityStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string PendingValue = "Pending"; + private const string IncompleteValue = "Incomplete"; + private const string CompleteValue = "Complete"; + + /// None. + public static DataAvailabilityStatus None { get; } = new DataAvailabilityStatus(NoneValue); + /// Pending. + public static DataAvailabilityStatus Pending { get; } = new DataAvailabilityStatus(PendingValue); + /// Incomplete. + public static DataAvailabilityStatus Incomplete { get; } = new DataAvailabilityStatus(IncompleteValue); + /// Complete. + public static DataAvailabilityStatus Complete { get; } = new DataAvailabilityStatus(CompleteValue); + /// Determines if two values are the same. + public static bool operator ==(DataAvailabilityStatus left, DataAvailabilityStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataAvailabilityStatus left, DataAvailabilityStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataAvailabilityStatus(string value) => new DataAvailabilityStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataAvailabilityStatus other && Equals(other); + /// + public bool Equals(DataAvailabilityStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs index c86ee0d0d53b0..6b0025c155159 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - if (Optional.IsDefined(DataSegment)) - { - if (DataSegment != null) - { - writer.WritePropertyName("dataSegment"u8); - writer.WriteObjectValue(DataSegment, options); - } - else - { - writer.WriteNull("dataSegment"); - } - } if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) { if (FeatureDataTypeOverride != null) @@ -56,6 +44,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("featureDataTypeOverride"); } } + if (Optional.IsDefined(FeatureImportanceSettings)) + { + if (FeatureImportanceSettings != null) + { + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); + } + else + { + writer.WriteNull("featureImportanceSettings"); + } + } if (Optional.IsDefined(Features)) { if (Features != null) @@ -79,10 +79,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -142,29 +154,19 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J { return null; } - MonitoringDataSegment dataSegment = default; IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; MonitoringFeatureFilterBase features = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("dataSegment"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - dataSegment = null; - continue; - } - dataSegment = MonitoringDataSegment.DeserializeMonitoringDataSegment(property.Value, options); - continue; - } if (property.NameEquals("featureDataTypeOverride"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -180,6 +182,16 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J featureDataTypeOverride = dictionary; continue; } + if (property.NameEquals("featureImportanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureImportanceSettings = null; + continue; + } + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -210,13 +222,19 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -246,12 +264,12 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J } serializedAdditionalRawData = rawDataDictionary; return new DataDriftMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, - dataSegment, featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, features, metricThresholds, productionData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs index 8ebd4c0c95c0a..b12edc740dd84 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs @@ -23,12 +23,12 @@ public partial class DataDriftMonitoringSignal : MonitoringSignalBase /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// , or is null. public DataDriftMonitoringSignal(IEnumerable metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) @@ -45,12 +45,12 @@ public DataDriftMonitoringSignal(IEnumerable metri } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - /// The data segment used for scoping on a subset of the data population. /// A dictionary that maps feature names to their respective data types. + /// The settings for computing feature importance. /// /// The feature filter which identifies which feature to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -64,17 +64,17 @@ public DataDriftMonitoringSignal(IEnumerable metri /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal DataDriftMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, MonitoringDataSegment dataSegment, IDictionary featureDataTypeOverride, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal DataDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { - DataSegment = dataSegment; FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; Features = features; MetricThresholds = metricThresholds; ProductionData = productionData; @@ -87,10 +87,10 @@ internal DataDriftMonitoringSignal() { } - /// The data segment used for scoping on a subset of the data population. - public MonitoringDataSegment DataSegment { get; set; } /// A dictionary that maps feature names to their respective data types. public IDictionary FeatureDataTypeOverride { get; set; } + /// The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// /// The feature filter which identifies which feature to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -106,13 +106,13 @@ internal DataDriftMonitoringSignal() /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ProductionData { get; set; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs deleted file mode 100644 index 970167633c6e2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.Serialization.cs +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class DataImport : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImport)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(Source)) - { - if (Source != null) - { - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - } - else - { - writer.WriteNull("source"); - } - } - writer.WritePropertyName("dataType"u8); - writer.WriteStringValue(DataType.ToString()); - writer.WritePropertyName("dataUri"u8); - writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } - if (Optional.IsDefined(IsAnonymous)) - { - writer.WritePropertyName("isAnonymous"u8); - writer.WriteBooleanValue(IsAnonymous.Value); - } - if (Optional.IsDefined(IsArchived)) - { - writer.WritePropertyName("isArchived"u8); - writer.WriteBooleanValue(IsArchived.Value); - } - if (Optional.IsDefined(Description)) - { - if (Description != null) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - else - { - writer.WriteNull("description"); - } - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataImport IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImport)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataImport(document.RootElement, options); - } - - internal static DataImport DeserializeDataImport(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string assetName = default; - DataImportSource source = default; - MachineLearningDataType dataType = default; - Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; - bool? isAnonymous = default; - bool? isArchived = default; - string description = default; - IDictionary properties = default; - IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - source = null; - continue; - } - source = DataImportSource.DeserializeDataImportSource(property.Value, options); - continue; - } - if (property.NameEquals("dataType"u8)) - { - dataType = new MachineLearningDataType(property.Value.GetString()); - continue; - } - if (property.NameEquals("dataUri"u8)) - { - dataUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } - if (property.NameEquals("isAnonymous"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isAnonymous = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isArchived"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isArchived = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("description"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - description = null; - continue; - } - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataImport( - description, - properties ?? new ChangeTrackingDictionary(), - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - autoDeleteSetting, - isAnonymous, - isArchived, - dataType, - dataUri, - intellectualProperty, - stage, - assetName, - source); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataImport)} does not support writing '{options.Format}' format."); - } - } - - DataImport IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataImport(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataImport)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs deleted file mode 100644 index 683e6b78bbeb1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImport.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The DataImport. - public partial class DataImport : MachineLearningDataVersionProperties - { - /// Initializes a new instance of . - /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// is null. - public DataImport(Uri dataUri) : base(dataUri) - { - Argument.AssertNotNull(dataUri, nameof(dataUri)); - - DataType = MachineLearningDataType.UriFolder; - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. - /// [Required] Specifies the type of data. - /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - /// Name of the asset for data import job to create. - /// - /// Source data of the asset to import from - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - internal DataImport(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage, string assetName, DataImportSource source) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) - { - AssetName = assetName; - Source = source; - DataType = dataType; - } - - /// Initializes a new instance of for deserialization. - internal DataImport() - { - } - - /// Name of the asset for data import job to create. - public string AssetName { get; set; } - /// - /// Source data of the asset to import from - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public DataImportSource Source { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs deleted file mode 100644 index 9e7d478387162..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.Serialization.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownDataImportSource))] - public partial class DataImportSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Connection)) - { - if (Connection != null) - { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); - } - else - { - writer.WriteNull("connection"); - } - } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataImportSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImportSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataImportSource(document.RootElement, options); - } - - internal static DataImportSource DeserializeDataImportSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("sourceType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "database": return DatabaseSource.DeserializeDatabaseSource(element, options); - case "file_system": return FileSystemSource.DeserializeFileSystemSource(element, options); - } - } - return UnknownDataImportSource.DeserializeUnknownDataImportSource(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{options.Format}' format."); - } - } - - DataImportSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataImportSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs deleted file mode 100644 index aab5956201d6d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSourceType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum to determine the type of data. - internal readonly partial struct DataImportSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataImportSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DatabaseValue = "database"; - private const string FileSystemValue = "file_system"; - - /// database. - public static DataImportSourceType Database { get; } = new DataImportSourceType(DatabaseValue); - /// file_system. - public static DataImportSourceType FileSystem { get; } = new DataImportSourceType(FileSystemValue); - /// Determines if two values are the same. - public static bool operator ==(DataImportSourceType left, DataImportSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataImportSourceType left, DataImportSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DataImportSourceType(string value) => new DataImportSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataImportSourceType other && Equals(other); - /// - public bool Equals(DataImportSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs index 5c49d8e52292b..a306c83986c8c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs @@ -44,6 +44,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("featureDataTypeOverride"); } } + if (Optional.IsDefined(FeatureImportanceSettings)) + { + if (FeatureImportanceSettings != null) + { + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); + } + else + { + writer.WriteNull("featureImportanceSettings"); + } + } if (Optional.IsDefined(Features)) { if (Features != null) @@ -67,10 +79,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -131,11 +155,12 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign return null; } IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; MonitoringFeatureFilterBase features = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; @@ -157,6 +182,16 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign featureDataTypeOverride = dictionary; continue; } + if (property.NameEquals("featureImportanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureImportanceSettings = null; + continue; + } + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -187,13 +222,19 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -223,11 +264,12 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign } serializedAdditionalRawData = rawDataDictionary; return new DataQualityMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, features, metricThresholds, productionData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs index 0beb09ed161ea..c33c8b7923324 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs @@ -23,12 +23,12 @@ public partial class DataQualityMonitoringSignal : MonitoringSignalBase /// /// [Required] The data produced by the production service which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// , or is null. public DataQualityMonitoringSignal(IEnumerable metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) @@ -45,11 +45,12 @@ public DataQualityMonitoringSignal(IEnumerable m } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. /// A dictionary that maps feature names to their respective data types. + /// The settings for computing feature importance. /// /// The features to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -63,16 +64,17 @@ public DataQualityMonitoringSignal(IEnumerable m /// /// [Required] The data produced by the production service which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal DataQualityMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal DataQualityMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; Features = features; MetricThresholds = metricThresholds; ProductionData = productionData; @@ -87,6 +89,8 @@ internal DataQualityMonitoringSignal() /// A dictionary that maps feature names to their respective data types. public IDictionary FeatureDataTypeOverride { get; set; } + /// The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// /// The features to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -102,13 +106,13 @@ internal DataQualityMonitoringSignal() /// /// [Required] The data produced by the production service which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ProductionData { get; set; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs new file mode 100644 index 0000000000000..fbcec599988b7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.Serialization.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownDataReferenceCredential))] + public partial class DataReferenceCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DataReferenceCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReferenceCredential(document.RootElement, options); + } + + internal static DataReferenceCredential DeserializeDataReferenceCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("credentialType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "DockerCredentials": return DockerCredential.DeserializeDockerCredential(element, options); + case "ManagedIdentity": return ManagedIdentityCredential.DeserializeManagedIdentityCredential(element, options); + case "NoCredentials": return AnonymousAccessCredential.DeserializeAnonymousAccessCredential(element, options); + case "SAS": return SasCredential.DeserializeSasCredential(element, options); + } + } + return UnknownDataReferenceCredential.DeserializeUnknownDataReferenceCredential(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{options.Format}' format."); + } + } + + DataReferenceCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataReferenceCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.cs similarity index 63% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.cs index ee07f315e4449..089ec7b699bc7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataImportSource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredential.cs @@ -11,10 +11,11 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// DataReferenceCredential base class + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . /// - public abstract partial class DataImportSource + public abstract partial class DataReferenceCredential { /// /// Keeps track of any properties unknown to the library. @@ -48,25 +49,21 @@ public abstract partial class DataImportSource /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected DataImportSource() + /// Initializes a new instance of . + protected DataReferenceCredential() { } - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. /// Keeps track of any properties unknown to the library. - internal DataImportSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData) + internal DataReferenceCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData) { - Connection = connection; - SourceType = sourceType; + CredentialType = credentialType; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Workspace connection for data import source storage. - public string Connection { get; set; } - /// [Required] Specifies the type of data. - internal DataImportSourceType SourceType { get; set; } + /// [Required] Credential type used to authentication with storage. + internal DataReferenceCredentialType CredentialType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.cs new file mode 100644 index 0000000000000..53ea40481a158 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataReferenceCredentialType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to determine the DataReference credentials type. + internal readonly partial struct DataReferenceCredentialType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReferenceCredentialType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SasValue = "SAS"; + private const string DockerCredentialsValue = "DockerCredentials"; + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string NoCredentialsValue = "NoCredentials"; + + /// SAS. + public static DataReferenceCredentialType Sas { get; } = new DataReferenceCredentialType(SasValue); + /// DockerCredentials. + public static DataReferenceCredentialType DockerCredentials { get; } = new DataReferenceCredentialType(DockerCredentialsValue); + /// ManagedIdentity. + public static DataReferenceCredentialType ManagedIdentity { get; } = new DataReferenceCredentialType(ManagedIdentityValue); + /// NoCredentials. + public static DataReferenceCredentialType NoCredentials { get; } = new DataReferenceCredentialType(NoCredentialsValue); + /// Determines if two values are the same. + public static bool operator ==(DataReferenceCredentialType left, DataReferenceCredentialType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReferenceCredentialType left, DataReferenceCredentialType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataReferenceCredentialType(string value) => new DataReferenceCredentialType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReferenceCredentialType other && Equals(other); + /// + public bool Equals(DataReferenceCredentialType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs deleted file mode 100644 index d25a95f94cbed..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.Serialization.cs +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class DatabaseSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DatabaseSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Query)) - { - if (Query != null) - { - writer.WritePropertyName("query"u8); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } - } - if (Optional.IsDefined(StoredProcedure)) - { - if (StoredProcedure != null) - { - writer.WritePropertyName("storedProcedure"u8); - writer.WriteStringValue(StoredProcedure); - } - else - { - writer.WriteNull("storedProcedure"); - } - } - if (Optional.IsCollectionDefined(StoredProcedureParams)) - { - if (StoredProcedureParams != null) - { - writer.WritePropertyName("storedProcedureParams"u8); - writer.WriteStartArray(); - foreach (var item in StoredProcedureParams) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartObject(); - foreach (var item0 in item) - { - writer.WritePropertyName(item0.Key); - writer.WriteStringValue(item0.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("storedProcedureParams"); - } - } - if (Optional.IsDefined(TableName)) - { - if (TableName != null) - { - writer.WritePropertyName("tableName"u8); - writer.WriteStringValue(TableName); - } - else - { - writer.WriteNull("tableName"); - } - } - if (Optional.IsDefined(Connection)) - { - if (Connection != null) - { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); - } - else - { - writer.WriteNull("connection"); - } - } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DatabaseSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DatabaseSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDatabaseSource(document.RootElement, options); - } - - internal static DatabaseSource DeserializeDatabaseSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string query = default; - string storedProcedure = default; - IList> storedProcedureParams = default; - string tableName = default; - string connection = default; - DataImportSourceType sourceType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("query"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } - query = property.Value.GetString(); - continue; - } - if (property.NameEquals("storedProcedure"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - storedProcedure = null; - continue; - } - storedProcedure = property.Value.GetString(); - continue; - } - if (property.NameEquals("storedProcedureParams"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - storedProcedureParams = null; - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in item.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - array.Add(dictionary); - } - } - storedProcedureParams = array; - continue; - } - if (property.NameEquals("tableName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tableName = null; - continue; - } - tableName = property.Value.GetString(); - continue; - } - if (property.NameEquals("connection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connection = null; - continue; - } - connection = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceType"u8)) - { - sourceType = new DataImportSourceType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DatabaseSource( - connection, - sourceType, - serializedAdditionalRawData, - query, - storedProcedure, - storedProcedureParams ?? new ChangeTrackingList>(), - tableName); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DatabaseSource)} does not support writing '{options.Format}' format."); - } - } - - DatabaseSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDatabaseSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DatabaseSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs deleted file mode 100644 index 8fe8540dd4173..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatabaseSource.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The DatabaseSource. - public partial class DatabaseSource : DataImportSource - { - /// Initializes a new instance of . - public DatabaseSource() - { - StoredProcedureParams = new ChangeTrackingList>(); - SourceType = DataImportSourceType.Database; - } - - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. - /// Keeps track of any properties unknown to the library. - /// SQL Query statement for data import Database source. - /// SQL StoredProcedure on data import Database source. - /// SQL StoredProcedure parameters. - /// Name of the table on data import Database source. - internal DatabaseSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData, string query, string storedProcedure, IList> storedProcedureParams, string tableName) : base(connection, sourceType, serializedAdditionalRawData) - { - Query = query; - StoredProcedure = storedProcedure; - StoredProcedureParams = storedProcedureParams; - TableName = tableName; - SourceType = sourceType; - } - - /// SQL Query statement for data import Database source. - public string Query { get; set; } - /// SQL StoredProcedure on data import Database source. - public string StoredProcedure { get; set; } - /// SQL StoredProcedure parameters. - public IList> StoredProcedureParams { get; set; } - /// Name of the table on data import Database source. - public string TableName { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs deleted file mode 100644 index 4d2dd07a9bbff..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.Serialization.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class DatasetExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(LabeledAssetName)) - { - if (LabeledAssetName != null) - { - writer.WritePropertyName("labeledAssetName"u8); - writer.WriteStringValue(LabeledAssetName); - } - else - { - writer.WriteNull("labeledAssetName"); - } - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DatasetExportSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDatasetExportSummary(document.RootElement, options); - } - - internal static DatasetExportSummary DeserializeDatasetExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string labeledAssetName = default; - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = default; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("labeledAssetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labeledAssetName = null; - continue; - } - labeledAssetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DatasetExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData, - labeledAssetName); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support writing '{options.Format}' format."); - } - } - - DatasetExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDatasetExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DatasetExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs deleted file mode 100644 index 8dd335d9531de..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatasetExportSummary.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The DatasetExportSummary. - public partial class DatasetExportSummary : ExportSummary - { - /// Initializes a new instance of . - public DatasetExportSummary() - { - Format = ExportFormatType.Dataset; - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - /// The unique name of the labeled data asset. - internal DatasetExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData, string labeledAssetName) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - LabeledAssetName = labeledAssetName; - Format = format; - } - - /// The unique name of the labeled data asset. - public string LabeledAssetName { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs index 5fa1aabc66cbe..222080975d92d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DatastoreType.cs @@ -26,7 +26,6 @@ public DatastoreType(string value) private const string AzureDataLakeGen1Value = "AzureDataLakeGen1"; private const string AzureDataLakeGen2Value = "AzureDataLakeGen2"; private const string AzureFileValue = "AzureFile"; - private const string HdfsValue = "Hdfs"; private const string OneLakeValue = "OneLake"; /// AzureBlob. @@ -37,8 +36,6 @@ public DatastoreType(string value) public static DatastoreType AzureDataLakeGen2 { get; } = new DatastoreType(AzureDataLakeGen2Value); /// AzureFile. public static DatastoreType AzureFile { get; } = new DatastoreType(AzureFileValue); - /// Hdfs. - public static DatastoreType Hdfs { get; } = new DatastoreType(HdfsValue); /// OneLake. public static DatastoreType OneLake { get; } = new DatastoreType(OneLakeValue); /// Determines if two values are the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs new file mode 100644 index 0000000000000..86281efb3fc5e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The DefaultResourceProvisioningState. + public readonly partial struct DefaultResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DefaultResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string FailedValue = "Failed"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string SucceededValue = "Succeeded"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + private const string CanceledValue = "Canceled"; + private const string ScalingValue = "Scaling"; + private const string DisabledValue = "Disabled"; + + /// NotStarted. + public static DefaultResourceProvisioningState NotStarted { get; } = new DefaultResourceProvisioningState(NotStartedValue); + /// Failed. + public static DefaultResourceProvisioningState Failed { get; } = new DefaultResourceProvisioningState(FailedValue); + /// Creating. + public static DefaultResourceProvisioningState Creating { get; } = new DefaultResourceProvisioningState(CreatingValue); + /// Updating. + public static DefaultResourceProvisioningState Updating { get; } = new DefaultResourceProvisioningState(UpdatingValue); + /// Succeeded. + public static DefaultResourceProvisioningState Succeeded { get; } = new DefaultResourceProvisioningState(SucceededValue); + /// Deleting. + public static DefaultResourceProvisioningState Deleting { get; } = new DefaultResourceProvisioningState(DeletingValue); + /// Accepted. + public static DefaultResourceProvisioningState Accepted { get; } = new DefaultResourceProvisioningState(AcceptedValue); + /// Canceled. + public static DefaultResourceProvisioningState Canceled { get; } = new DefaultResourceProvisioningState(CanceledValue); + /// Scaling. + public static DefaultResourceProvisioningState Scaling { get; } = new DefaultResourceProvisioningState(ScalingValue); + /// Disabled. + public static DefaultResourceProvisioningState Disabled { get; } = new DefaultResourceProvisioningState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DefaultResourceProvisioningState left, DefaultResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DefaultResourceProvisioningState left, DefaultResourceProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DefaultResourceProvisioningState(string value) => new DefaultResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DefaultResourceProvisioningState other && Equals(other); + /// + public bool Equals(DefaultResourceProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs new file mode 100644 index 0000000000000..71e8365741da1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Deployment model version upgrade option. + public readonly partial struct DeploymentModelVersionUpgradeOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeploymentModelVersionUpgradeOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OnceNewDefaultVersionAvailableValue = "OnceNewDefaultVersionAvailable"; + private const string OnceCurrentVersionExpiredValue = "OnceCurrentVersionExpired"; + private const string NoAutoUpgradeValue = "NoAutoUpgrade"; + + /// OnceNewDefaultVersionAvailable. + public static DeploymentModelVersionUpgradeOption OnceNewDefaultVersionAvailable { get; } = new DeploymentModelVersionUpgradeOption(OnceNewDefaultVersionAvailableValue); + /// OnceCurrentVersionExpired. + public static DeploymentModelVersionUpgradeOption OnceCurrentVersionExpired { get; } = new DeploymentModelVersionUpgradeOption(OnceCurrentVersionExpiredValue); + /// NoAutoUpgrade. + public static DeploymentModelVersionUpgradeOption NoAutoUpgrade { get; } = new DeploymentModelVersionUpgradeOption(NoAutoUpgradeValue); + /// Determines if two values are the same. + public static bool operator ==(DeploymentModelVersionUpgradeOption left, DeploymentModelVersionUpgradeOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeploymentModelVersionUpgradeOption left, DeploymentModelVersionUpgradeOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DeploymentModelVersionUpgradeOption(string value) => new DeploymentModelVersionUpgradeOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeploymentModelVersionUpgradeOption other && Equals(other); + /// + public bool Equals(DeploymentModelVersionUpgradeOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs index 3bc30bf691917..df0e662e5b33b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs @@ -13,58 +13,53 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class JobStatusMessage : IUtf8JsonSerializable, IJsonModel + public partial class DestinationAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Code)) + if (Optional.IsDefined(DestinationName)) { - if (Code != null) + if (DestinationName != null) { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); + writer.WritePropertyName("destinationName"u8); + writer.WriteStringValue(DestinationName); } else { - writer.WriteNull("code"); + writer.WriteNull("destinationName"); } } - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + if (Optional.IsDefined(DestinationVersion)) { - if (CreatedOn != null) + if (DestinationVersion != null) { - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); + writer.WritePropertyName("destinationVersion"u8); + writer.WriteStringValue(DestinationVersion); } else { - writer.WriteNull("createdDateTime"); + writer.WriteNull("destinationVersion"); } } - if (options.Format != "W" && Optional.IsDefined(Level)) + if (Optional.IsDefined(RegistryName)) { - writer.WritePropertyName("level"u8); - writer.WriteStringValue(Level.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Message)) - { - if (Message != null) + if (RegistryName != null) { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); + writer.WritePropertyName("registryName"u8); + writer.WriteStringValue(RegistryName); } else { - writer.WriteNull("message"); + writer.WriteNull("registryName"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -85,19 +80,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteEndObject(); } - JobStatusMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DestinationAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeJobStatusMessage(document.RootElement, options); + return DeserializeDestinationAsset(document.RootElement, options); } - internal static JobStatusMessage DeserializeJobStatusMessage(JsonElement element, ModelReaderWriterOptions options = null) + internal static DestinationAsset DeserializeDestinationAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -105,51 +100,41 @@ internal static JobStatusMessage DeserializeJobStatusMessage(JsonElement element { return null; } - string code = default; - DateTimeOffset? createdDateTime = default; - JobStatusMessageLevel? level = default; - string message = default; + string destinationName = default; + string destinationVersion = default; + string registryName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - code = null; - continue; - } - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) + if (property.NameEquals("destinationName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - createdDateTime = null; + destinationName = null; continue; } - createdDateTime = property.Value.GetDateTimeOffset("O"); + destinationName = property.Value.GetString(); continue; } - if (property.NameEquals("level"u8)) + if (property.NameEquals("destinationVersion"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + destinationVersion = null; continue; } - level = new JobStatusMessageLevel(property.Value.GetString()); + destinationVersion = property.Value.GetString(); continue; } - if (property.NameEquals("message"u8)) + if (property.NameEquals("registryName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - message = null; + registryName = null; continue; } - message = property.Value.GetString(); + registryName = property.Value.GetString(); continue; } if (options.Format != "W") @@ -158,38 +143,38 @@ internal static JobStatusMessage DeserializeJobStatusMessage(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new JobStatusMessage(code, createdDateTime, level, message, serializedAdditionalRawData); + return new DestinationAsset(destinationName, destinationVersion, registryName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support writing '{options.Format}' format."); } } - JobStatusMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DestinationAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeJobStatusMessage(document.RootElement, options); + return DeserializeDestinationAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(JobStatusMessage)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DestinationAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs new file mode 100644 index 0000000000000..bece271ecb213 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Publishing destination registry asset information. + public partial class DestinationAsset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DestinationAsset() + { + } + + /// Initializes a new instance of . + /// Destination asset name. + /// Destination asset version. + /// Destination registry name. + /// Keeps track of any properties unknown to the library. + internal DestinationAsset(string destinationName, string destinationVersion, string registryName, IDictionary serializedAdditionalRawData) + { + DestinationName = destinationName; + DestinationVersion = destinationVersion; + RegistryName = registryName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination asset name. + public string DestinationName { get; set; } + /// Destination asset version. + public string DestinationVersion { get; set; } + /// Destination registry name. + public string RegistryName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs index 0cda26ca37d6a..568146f816a64 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DistributionType.cs @@ -25,7 +25,6 @@ public DistributionType(string value) private const string PyTorchValue = "PyTorch"; private const string TensorFlowValue = "TensorFlow"; private const string MpiValue = "Mpi"; - private const string RayValue = "Ray"; /// PyTorch. public static DistributionType PyTorch { get; } = new DistributionType(PyTorchValue); @@ -33,8 +32,6 @@ public DistributionType(string value) public static DistributionType TensorFlow { get; } = new DistributionType(TensorFlowValue); /// Mpi. public static DistributionType Mpi { get; } = new DistributionType(MpiValue); - /// Ray. - public static DistributionType Ray { get; } = new DistributionType(RayValue); /// Determines if two values are the same. public static bool operator ==(DistributionType left, DistributionType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs index c41d6df8d6148..7803315daf2e1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs @@ -13,45 +13,45 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class FileSystemSource : IUtf8JsonSerializable, IJsonModel + public partial class DockerCredential : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FileSystemSource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Path)) + if (Optional.IsDefined(Password)) { - if (Path != null) + if (Password != null) { - writer.WritePropertyName("path"u8); - writer.WriteStringValue(Path); + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); } else { - writer.WriteNull("path"); + writer.WriteNull("password"); } } - if (Optional.IsDefined(Connection)) + if (Optional.IsDefined(UserName)) { - if (Connection != null) + if (UserName != null) { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); } else { - writer.WriteNull("connection"); + writer.WriteNull("userName"); } } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,19 +70,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteEndObject(); } - FileSystemSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DockerCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FileSystemSource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFileSystemSource(document.RootElement, options); + return DeserializeDockerCredential(document.RootElement, options); } - internal static FileSystemSource DeserializeFileSystemSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static DockerCredential DeserializeDockerCredential(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -90,36 +90,36 @@ internal static FileSystemSource DeserializeFileSystemSource(JsonElement element { return null; } - string path = default; - string connection = default; - DataImportSourceType sourceType = default; + string password = default; + string userName = default; + DataReferenceCredentialType credentialType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("path"u8)) + if (property.NameEquals("password"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - path = null; + password = null; continue; } - path = property.Value.GetString(); + password = property.Value.GetString(); continue; } - if (property.NameEquals("connection"u8)) + if (property.NameEquals("userName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - connection = null; + userName = null; continue; } - connection = property.Value.GetString(); + userName = property.Value.GetString(); continue; } - if (property.NameEquals("sourceType"u8)) + if (property.NameEquals("credentialType"u8)) { - sourceType = new DataImportSourceType(property.Value.GetString()); + credentialType = new DataReferenceCredentialType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -128,38 +128,38 @@ internal static FileSystemSource DeserializeFileSystemSource(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new FileSystemSource(connection, sourceType, serializedAdditionalRawData, path); + return new DockerCredential(credentialType, serializedAdditionalRawData, password, userName); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(FileSystemSource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support writing '{options.Format}' format."); } } - FileSystemSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DockerCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeFileSystemSource(document.RootElement, options); + return DeserializeDockerCredential(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(FileSystemSource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DockerCredential)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs new file mode 100644 index 0000000000000..6d43ca5bb6c33 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Credential for docker with username and password. + public partial class DockerCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal DockerCredential() + { + CredentialType = DataReferenceCredentialType.DockerCredentials; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + /// DockerCredential user password. + /// DockerCredential user name. + internal DockerCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string password, string userName) : base(credentialType, serializedAdditionalRawData) + { + Password = password; + UserName = userName; + CredentialType = credentialType; + } + + /// DockerCredential user password. + public string Password { get; } + /// DockerCredential user name. + public string UserName { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs deleted file mode 100644 index 7dad14ba63cb0..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class EmailMonitoringAlertNotificationSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EmailNotificationSetting)) - { - if (EmailNotificationSetting != null) - { - writer.WritePropertyName("emailNotificationSetting"u8); - writer.WriteObjectValue(EmailNotificationSetting, options); - } - else - { - writer.WriteNull("emailNotificationSetting"); - } - } - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - EmailMonitoringAlertNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEmailMonitoringAlertNotificationSettings(document.RootElement, options); - } - - internal static EmailMonitoringAlertNotificationSettings DeserializeEmailMonitoringAlertNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NotificationSetting emailNotificationSetting = default; - MonitoringAlertNotificationType alertNotificationType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("emailNotificationSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - emailNotificationSetting = null; - continue; - } - emailNotificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); - continue; - } - if (property.NameEquals("alertNotificationType"u8)) - { - alertNotificationType = new MonitoringAlertNotificationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new EmailMonitoringAlertNotificationSettings(alertNotificationType, serializedAdditionalRawData, emailNotificationSetting); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support writing '{options.Format}' format."); - } - } - - EmailMonitoringAlertNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEmailMonitoringAlertNotificationSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(EmailMonitoringAlertNotificationSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs deleted file mode 100644 index fe3c912a69315..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EmailMonitoringAlertNotificationSettings.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The EmailMonitoringAlertNotificationSettings. - public partial class EmailMonitoringAlertNotificationSettings : MonitoringAlertNotificationSettingsBase - { - /// Initializes a new instance of . - public EmailMonitoringAlertNotificationSettings() - { - AlertNotificationType = MonitoringAlertNotificationType.Email; - } - - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// Configuration for notification. - internal EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData, NotificationSetting emailNotificationSetting) : base(alertNotificationType, serializedAdditionalRawData) - { - EmailNotificationSetting = emailNotificationSetting; - AlertNotificationType = alertNotificationType; - } - - /// Configuration for notification. - public NotificationSetting EmailNotificationSetting { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs similarity index 53% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs index 600b2c5d349e6..292c2d1cbcdff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs @@ -13,33 +13,39 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class CustomInferencingServer : IUtf8JsonSerializable, IJsonModel + public partial class EndpointDeploymentModel : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(InferenceConfiguration)) + if (Optional.IsDefined(Format)) { - if (InferenceConfiguration != null) - { - writer.WritePropertyName("inferenceConfiguration"u8); - writer.WriteObjectValue(InferenceConfiguration, options); - } - else - { - writer.WriteNull("inferenceConfiguration"); - } + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - CustomInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EndpointDeploymentModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCustomInferencingServer(document.RootElement, options); + return DeserializeEndpointDeploymentModel(document.RootElement, options); } - internal static CustomInferencingServer DeserializeCustomInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static EndpointDeploymentModel DeserializeEndpointDeploymentModel(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +84,32 @@ internal static CustomInferencingServer DeserializeCustomInferencingServer(JsonE { return null; } - OnlineInferenceConfiguration inferenceConfiguration = default; - InferencingServerType serverType = default; + string format = default; + string name = default; + string source = default; + string version = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("inferenceConfiguration"u8)) + if (property.NameEquals("format"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inferenceConfiguration = null; - continue; - } - inferenceConfiguration = OnlineInferenceConfiguration.DeserializeOnlineInferenceConfiguration(property.Value, options); + format = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); continue; } - if (property.NameEquals("serverType"u8)) + if (property.NameEquals("version"u8)) { - serverType = new InferencingServerType(property.Value.GetString()); + version = property.Value.GetString(); continue; } if (options.Format != "W") @@ -105,38 +118,38 @@ internal static CustomInferencingServer DeserializeCustomInferencingServer(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new CustomInferencingServer(serverType, serializedAdditionalRawData, inferenceConfiguration); + return new EndpointDeploymentModel(format, name, source, version, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support writing '{options.Format}' format."); } } - CustomInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EndpointDeploymentModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCustomInferencingServer(document.RootElement, options); + return DeserializeEndpointDeploymentModel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CustomInferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs new file mode 100644 index 0000000000000..4e1d3dc918e34 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointDeploymentModel. + public partial class EndpointDeploymentModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EndpointDeploymentModel() + { + } + + /// Initializes a new instance of . + /// Model format. + /// Model name. + /// Optional. Deployment model source ARM resource ID. + /// Model version. + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentModel(string format, string name, string source, string version, IDictionary serializedAdditionalRawData) + { + Format = format; + Name = name; + Source = source; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Model format. + public string Format { get; set; } + /// Model name. + public string Name { get; set; } + /// Optional. Deployment model source ARM resource ID. + public string Source { get; set; } + /// Model version. + public string Version { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..e18d89d0b9391 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownEndpointDeploymentResourceProperties))] + public partial class EndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static EndpointDeploymentResourceProperties DeserializeEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Azure.ContentSafety": return ContentSafetyEndpointDeploymentResourceProperties.DeserializeContentSafetyEndpointDeploymentResourceProperties(element, options); + case "Azure.OpenAI": return OpenAIEndpointDeploymentResourceProperties.DeserializeOpenAIEndpointDeploymentResourceProperties(element, options); + case "Azure.Speech": return SpeechEndpointDeploymentResourceProperties.DeserializeSpeechEndpointDeploymentResourceProperties(element, options); + case "managedOnlineEndpoint": return ManagedOnlineEndpointDeploymentResourceProperties.DeserializeManagedOnlineEndpointDeploymentResourceProperties(element, options); + } + } + return UnknownEndpointDeploymentResourceProperties.DeserializeUnknownEndpointDeploymentResourceProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..15de34853098b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public abstract partial class EndpointDeploymentResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected EndpointDeploymentResourceProperties() + { + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData) + { + FailureReason = failureReason; + ProvisioningState = provisioningState; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The failure reason if the creation failed. + public string FailureReason { get; set; } + /// Read-only provision state status property. + public DefaultResourceProvisioningState? ProvisioningState { get; } + /// Kind of the deployment. + internal string EndpointDeploymentResourcePropertiesType { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..22be7b3575b8b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..6dc73af1f1d14 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. + internal partial class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs index 90dc15bb5338b..a8b023c028a57 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class AutologgerSettings : IUtf8JsonSerializable, IJsonModel + public partial class EndpointKeys : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mlflowAutologger"u8); - writer.WriteStringValue(MlflowAutologger.ToString()); + if (Optional.IsDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteObjectValue(Keys, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - AutologgerSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EndpointKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAutologgerSettings(document.RootElement, options); + return DeserializeEndpointKeys(document.RootElement, options); } - internal static AutologgerSettings DeserializeAutologgerSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static EndpointKeys DeserializeEndpointKeys(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,18 @@ internal static AutologgerSettings DeserializeAutologgerSettings(JsonElement ele { return null; } - MachineLearningFlowAutoLoggerState mlflowAutologger = default; + AccountApiKeys keys = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mlflowAutologger"u8)) + if (property.NameEquals("keys"u8)) { - mlflowAutologger = new MachineLearningFlowAutoLoggerState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keys = AccountApiKeys.DeserializeAccountApiKeys(property.Value, options); continue; } if (options.Format != "W") @@ -82,38 +89,38 @@ internal static AutologgerSettings DeserializeAutologgerSettings(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new AutologgerSettings(mlflowAutologger, serializedAdditionalRawData); + return new EndpointKeys(keys, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{options.Format}' format."); } } - AutologgerSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EndpointKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAutologgerSettings(document.RootElement, options); + return DeserializeEndpointKeys(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AutologgerSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs similarity index 71% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs index c5e34f1bdd178..e4909d100d654 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Instructions for labeling job. - internal partial class LabelingJobInstructions + /// The EndpointKeys. + public partial class EndpointKeys { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class LabelingJobInstructions /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelingJobInstructions() + /// Initializes a new instance of . + internal EndpointKeys() { } - /// Initializes a new instance of . - /// The link to a page with detailed labeling instructions for labelers. + /// Initializes a new instance of . + /// Dictionary of Keys for the endpoint. /// Keeps track of any properties unknown to the library. - internal LabelingJobInstructions(Uri uri, IDictionary serializedAdditionalRawData) + internal EndpointKeys(AccountApiKeys keys, IDictionary serializedAdditionalRawData) { - Uri = uri; + Keys = keys; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link to a page with detailed labeling instructions for labelers. - public Uri Uri { get; set; } + /// Dictionary of Keys for the endpoint. + public AccountApiKeys Keys { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs new file mode 100644 index 0000000000000..237093c21ec16 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelDeprecationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FineTune)) + { + writer.WritePropertyName("fineTune"u8); + writer.WriteStringValue(FineTune.Value, "O"); + } + if (Optional.IsDefined(Inference)) + { + writer.WritePropertyName("inference"u8); + writer.WriteStringValue(Inference.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelDeprecationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelDeprecationProperties(document.RootElement, options); + } + + internal static EndpointModelDeprecationProperties DeserializeEndpointModelDeprecationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? fineTune = default; + DateTimeOffset? inference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fineTune"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fineTune = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("inference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inference = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelDeprecationProperties(fineTune, inference, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelDeprecationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelDeprecationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs new file mode 100644 index 0000000000000..dd07142c21de8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelDeprecationProperties. + public partial class EndpointModelDeprecationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelDeprecationProperties() + { + } + + /// Initializes a new instance of . + /// The datetime of deprecation of the fineTune Model. + /// The datetime of deprecation of the inference Model. + /// Keeps track of any properties unknown to the library. + internal EndpointModelDeprecationProperties(DateTimeOffset? fineTune, DateTimeOffset? inference, IDictionary serializedAdditionalRawData) + { + FineTune = fineTune; + Inference = inference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The datetime of deprecation of the fineTune Model. + public DateTimeOffset? FineTune { get; } + /// The datetime of deprecation of the inference Model. + public DateTimeOffset? Inference { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs new file mode 100644 index 0000000000000..6b63c91cf7e41 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Capabilities)) + { + writer.WritePropertyName("capabilities"u8); + writer.WriteStartObject(); + foreach (var item in Capabilities) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Deprecation)) + { + writer.WritePropertyName("deprecation"u8); + writer.WriteObjectValue(Deprecation, options); + } + if (Optional.IsCollectionDefined(FinetuneCapabilities)) + { + writer.WritePropertyName("finetuneCapabilities"u8); + writer.WriteStartObject(); + foreach (var item in FinetuneCapabilities) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Format)) + { + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format); + } + if (Optional.IsDefined(IsDefaultVersion)) + { + writer.WritePropertyName("isDefaultVersion"u8); + writer.WriteBooleanValue(IsDefaultVersion.Value); + } + if (Optional.IsDefined(LifecycleStatus)) + { + writer.WritePropertyName("lifecycleStatus"u8); + writer.WriteStringValue(LifecycleStatus.Value.ToString()); + } + if (Optional.IsDefined(MaxCapacity)) + { + writer.WritePropertyName("maxCapacity"u8); + writer.WriteNumberValue(MaxCapacity.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Skus)) + { + writer.WritePropertyName("skus"u8); + writer.WriteStartArray(); + foreach (var item in Skus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelProperties(document.RootElement, options); + } + + internal static EndpointModelProperties DeserializeEndpointModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary capabilities = default; + EndpointModelDeprecationProperties deprecation = default; + IReadOnlyDictionary finetuneCapabilities = default; + string format = default; + bool? isDefaultVersion = default; + ModelLifecycleStatus? lifecycleStatus = default; + int? maxCapacity = default; + string name = default; + IReadOnlyList skus = default; + SystemData systemData = default; + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + capabilities = dictionary; + continue; + } + if (property.NameEquals("deprecation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deprecation = EndpointModelDeprecationProperties.DeserializeEndpointModelDeprecationProperties(property.Value, options); + continue; + } + if (property.NameEquals("finetuneCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + finetuneCapabilities = dictionary; + continue; + } + if (property.NameEquals("format"u8)) + { + format = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefaultVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefaultVersion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lifecycleStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleStatus = new ModelLifecycleStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("skus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuProperties.DeserializeEndpointModelSkuProperties(item, options)); + } + skus = array; + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelProperties( + capabilities ?? new ChangeTrackingDictionary(), + deprecation, + finetuneCapabilities ?? new ChangeTrackingDictionary(), + format, + isDefaultVersion, + lifecycleStatus, + maxCapacity, + name, + skus ?? new ChangeTrackingList(), + systemData, + version, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs new file mode 100644 index 0000000000000..a3b90e45318de --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Endpoint Model properties. + public partial class EndpointModelProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelProperties() + { + Capabilities = new ChangeTrackingDictionary(); + FinetuneCapabilities = new ChangeTrackingDictionary(); + Skus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The capabilities. + /// + /// The capabilities for finetune models. + /// Deployment model format. + /// If the model is default version. + /// Model lifecycle status. + /// The max capacity. + /// Deployment model name. + /// The list of Model Sku. + /// Metadata pertaining to creation and last modification of the resource. + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + /// Keeps track of any properties unknown to the library. + internal EndpointModelProperties(IReadOnlyDictionary capabilities, EndpointModelDeprecationProperties deprecation, IReadOnlyDictionary finetuneCapabilities, string format, bool? isDefaultVersion, ModelLifecycleStatus? lifecycleStatus, int? maxCapacity, string name, IReadOnlyList skus, SystemData systemData, string version, IDictionary serializedAdditionalRawData) + { + Capabilities = capabilities; + Deprecation = deprecation; + FinetuneCapabilities = finetuneCapabilities; + Format = format; + IsDefaultVersion = isDefaultVersion; + LifecycleStatus = lifecycleStatus; + MaxCapacity = maxCapacity; + Name = name; + Skus = skus; + SystemData = systemData; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The capabilities. + public IReadOnlyDictionary Capabilities { get; } + /// Gets the deprecation. + public EndpointModelDeprecationProperties Deprecation { get; } + /// The capabilities for finetune models. + public IReadOnlyDictionary FinetuneCapabilities { get; } + /// Deployment model format. + public string Format { get; } + /// If the model is default version. + public bool? IsDefaultVersion { get; } + /// Model lifecycle status. + public ModelLifecycleStatus? LifecycleStatus { get; } + /// The max capacity. + public int? MaxCapacity { get; } + /// Deployment model name. + public string Name { get; } + /// The list of Model Sku. + public IReadOnlyList Skus { get; } + /// Metadata pertaining to creation and last modification of the resource. + public SystemData SystemData { get; } + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + public string Version { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs new file mode 100644 index 0000000000000..f3984d3369c3e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuCapacityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"u8); + writer.WriteNumberValue(Default.Value); + } + if (Optional.IsDefined(Maximum)) + { + writer.WritePropertyName("maximum"u8); + writer.WriteNumberValue(Maximum.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuCapacityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuCapacityProperties(document.RootElement, options); + } + + internal static EndpointModelSkuCapacityProperties DeserializeEndpointModelSkuCapacityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? @default = default; + int? maximum = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("default"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @default = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximum = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuCapacityProperties(@default, maximum, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuCapacityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuCapacityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs new file mode 100644 index 0000000000000..acdc267a87f2d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuCapacityProperties. + public partial class EndpointModelSkuCapacityProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuCapacityProperties() + { + } + + /// Initializes a new instance of . + /// The default capacity. + /// The maximum capacity. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuCapacityProperties(int? @default, int? maximum, IDictionary serializedAdditionalRawData) + { + Default = @default; + Maximum = maximum; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The default capacity. + public int? Default { get; } + /// The maximum capacity. + public int? Maximum { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs new file mode 100644 index 0000000000000..64bd30a6de0ed --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteObjectValue(Capacity, options); + } + if (Optional.IsCollectionDefined(ConnectionIds)) + { + writer.WritePropertyName("connectionIds"u8); + writer.WriteStartArray(); + foreach (var item in ConnectionIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DeprecationOn)) + { + writer.WritePropertyName("deprecationDate"u8); + writer.WriteStringValue(DeprecationOn.Value, "O"); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(RateLimits)) + { + writer.WritePropertyName("rateLimits"u8); + writer.WriteStartArray(); + foreach (var item in RateLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UsageName)) + { + writer.WritePropertyName("usageName"u8); + writer.WriteStringValue(UsageName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuProperties(document.RootElement, options); + } + + internal static EndpointModelSkuProperties DeserializeEndpointModelSkuProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointModelSkuCapacityProperties capacity = default; + IReadOnlyList connectionIds = default; + DateTimeOffset? deprecationDate = default; + string name = default; + IReadOnlyList rateLimits = default; + string usageName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = EndpointModelSkuCapacityProperties.DeserializeEndpointModelSkuCapacityProperties(property.Value, options); + continue; + } + if (property.NameEquals("connectionIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + connectionIds = array; + continue; + } + if (property.NameEquals("deprecationDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deprecationDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rateLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitProperties.DeserializeEndpointModelSkuRateLimitProperties(item, options)); + } + rateLimits = array; + continue; + } + if (property.NameEquals("usageName"u8)) + { + usageName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuProperties( + capacity, + connectionIds ?? new ChangeTrackingList(), + deprecationDate, + name, + rateLimits ?? new ChangeTrackingList(), + usageName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs new file mode 100644 index 0000000000000..a66d13356c5e5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuProperties. + public partial class EndpointModelSkuProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuProperties() + { + ConnectionIds = new ChangeTrackingList(); + RateLimits = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The list of ARM id for the connection support this SKU. + /// The datetime of deprecation of the model SKU. + /// The name of the model SKU. + /// + /// The usage name of the model SKU. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuProperties(EndpointModelSkuCapacityProperties capacity, IReadOnlyList connectionIds, DateTimeOffset? deprecationOn, string name, IReadOnlyList rateLimits, string usageName, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + ConnectionIds = connectionIds; + DeprecationOn = deprecationOn; + Name = name; + RateLimits = rateLimits; + UsageName = usageName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the capacity. + public EndpointModelSkuCapacityProperties Capacity { get; } + /// The list of ARM id for the connection support this SKU. + public IReadOnlyList ConnectionIds { get; } + /// The datetime of deprecation of the model SKU. + public DateTimeOffset? DeprecationOn { get; } + /// The name of the model SKU. + public string Name { get; } + /// Gets the rate limits. + public IReadOnlyList RateLimits { get; } + /// The usage name of the model SKU. + public string UsageName { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs new file mode 100644 index 0000000000000..c5881ffcc7cdb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(RenewalPeriod)) + { + writer.WritePropertyName("renewalPeriod"u8); + writer.WriteNumberValue(RenewalPeriod.Value); + } + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitProperties DeserializeEndpointModelSkuRateLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? count = default; + float? renewalPeriod = default; + IReadOnlyList rules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("renewalPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + renewalPeriod = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitRuleProperties.DeserializeEndpointModelSkuRateLimitRuleProperties(item, options)); + } + rules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitProperties(count, renewalPeriod, rules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs index fa2a427ad0a8a..2d3c8862689ae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Label category definition. - public partial class LabelCategory + /// The EndpointModelSkuRateLimitProperties. + public partial class EndpointModelSkuRateLimitProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,30 +45,30 @@ public partial class LabelCategory /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelCategory() + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitProperties() { - Classes = new ChangeTrackingDictionary(); + Rules = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Dictionary of label classes in this category. - /// Display name of the label category. - /// Indicates whether it is allowed to select multiple classes in this category. + /// Initializes a new instance of . + /// The count value of Call Rate Limit. + /// The renewal period in seconds of Call Rate Limit. + /// The call rate limit for the model. /// Keeps track of any properties unknown to the library. - internal LabelCategory(IDictionary classes, string displayName, LabelCategoryMultiSelect? multiSelect, IDictionary serializedAdditionalRawData) + internal EndpointModelSkuRateLimitProperties(float? count, float? renewalPeriod, IReadOnlyList rules, IDictionary serializedAdditionalRawData) { - Classes = classes; - DisplayName = displayName; - MultiSelect = multiSelect; + Count = count; + RenewalPeriod = renewalPeriod; + Rules = rules; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Dictionary of label classes in this category. - public IDictionary Classes { get; set; } - /// Display name of the label category. - public string DisplayName { get; set; } - /// Indicates whether it is allowed to select multiple classes in this category. - public LabelCategoryMultiSelect? MultiSelect { get; set; } + /// The count value of Call Rate Limit. + public float? Count { get; } + /// The renewal period in seconds of Call Rate Limit. + public float? RenewalPeriod { get; } + /// The call rate limit for the model. + public IReadOnlyList Rules { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs new file mode 100644 index 0000000000000..ee3fd37ac487a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitRulePatternProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Method)) + { + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitRulePatternProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitRulePatternProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitRulePatternProperties DeserializeEndpointModelSkuRateLimitRulePatternProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string method = default; + string path = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = property.Value.GetString(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitRulePatternProperties(method, path, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitRulePatternProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitRulePatternProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs similarity index 65% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs index 57575cf8e1115..d29360a98c739 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Label class definition. - public partial class LabelClass + /// The EndpointModelSkuRateLimitRulePatternProperties. + public partial class EndpointModelSkuRateLimitRulePatternProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ public partial class LabelClass /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelClass() + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitRulePatternProperties() { - Subclasses = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . - /// Display name of the label class. - /// Dictionary of subclasses of the label class. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal LabelClass(string displayName, IDictionary subclasses, IDictionary serializedAdditionalRawData) + internal EndpointModelSkuRateLimitRulePatternProperties(string method, string path, IDictionary serializedAdditionalRawData) { - DisplayName = displayName; - Subclasses = subclasses; + Method = method; + Path = path; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Display name of the label class. - public string DisplayName { get; set; } - /// Dictionary of subclasses of the label class. - public IDictionary Subclasses { get; set; } + /// Gets the method. + public string Method { get; } + /// Gets the path. + public string Path { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs new file mode 100644 index 0000000000000..7c8109967e7e6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(DynamicThrottlingEnabled)) + { + writer.WritePropertyName("dynamicThrottlingEnabled"u8); + writer.WriteBooleanValue(DynamicThrottlingEnabled.Value); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (Optional.IsCollectionDefined(MatchPatterns)) + { + writer.WritePropertyName("matchPatterns"u8); + writer.WriteStartArray(); + foreach (var item in MatchPatterns) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(MinCount)) + { + writer.WritePropertyName("minCount"u8); + writer.WriteNumberValue(MinCount.Value); + } + if (Optional.IsDefined(RenewalPeriod)) + { + writer.WritePropertyName("renewalPeriod"u8); + writer.WriteNumberValue(RenewalPeriod.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitRuleProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitRuleProperties DeserializeEndpointModelSkuRateLimitRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? count = default; + bool? dynamicThrottlingEnabled = default; + string key = default; + IReadOnlyList matchPatterns = default; + float? minCount = default; + float? renewalPeriod = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("dynamicThrottlingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicThrottlingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("matchPatterns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitRulePatternProperties.DeserializeEndpointModelSkuRateLimitRulePatternProperties(item, options)); + } + matchPatterns = array; + continue; + } + if (property.NameEquals("minCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("renewalPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + renewalPeriod = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitRuleProperties( + count, + dynamicThrottlingEnabled, + key, + matchPatterns ?? new ChangeTrackingList(), + minCount, + renewalPeriod, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs new file mode 100644 index 0000000000000..7e849da74a33e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuRateLimitRuleProperties. + public partial class EndpointModelSkuRateLimitRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitRuleProperties() + { + MatchPatterns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// If the dynamic throttling is enabled. + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuRateLimitRuleProperties(float? count, bool? dynamicThrottlingEnabled, string key, IReadOnlyList matchPatterns, float? minCount, float? renewalPeriod, IDictionary serializedAdditionalRawData) + { + Count = count; + DynamicThrottlingEnabled = dynamicThrottlingEnabled; + Key = key; + MatchPatterns = matchPatterns; + MinCount = minCount; + RenewalPeriod = renewalPeriod; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the count. + public float? Count { get; } + /// If the dynamic throttling is enabled. + public bool? DynamicThrottlingEnabled { get; } + /// Gets the key. + public string Key { get; } + /// Gets the match patterns. + public IReadOnlyList MatchPatterns { get; } + /// Gets the min count. + public float? MinCount { get; } + /// Gets the renewal period. + public float? RenewalPeriod { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs similarity index 61% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs index 030e656ed4382..7ae88a9ca51f0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class FeaturesetJobArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + internal partial class EndpointModels : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteEndObject(); } - FeaturesetJobArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EndpointModels IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFeaturesetJobArmPaginatedResult(document.RootElement, options); + return DeserializeEndpointModels(document.RootElement, options); } - internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static EndpointModels DeserializeEndpointModels(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -80,7 +80,7 @@ internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPagin return null; } string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,10 +96,10 @@ internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPagin { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MachineLearningFeatureSetJob.DeserializeMachineLearningFeatureSetJob(item, options)); + array.Add(EndpointModelProperties.DeserializeEndpointModelProperties(item, options)); } value = array; continue; @@ -110,38 +110,38 @@ internal static FeaturesetJobArmPaginatedResult DeserializeFeaturesetJobArmPagin } } serializedAdditionalRawData = rawDataDictionary; - return new FeaturesetJobArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new EndpointModels(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{options.Format}' format."); } } - FeaturesetJobArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EndpointModels IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeFeaturesetJobArmPaginatedResult(document.RootElement, options); + return DeserializeEndpointModels(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(FeaturesetJobArmPaginatedResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs new file mode 100644 index 0000000000000..2cf98fe420c23 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModels. + internal partial class EndpointModels + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModels() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The link to the next page constructed using the continuationToken. If null, there are no additional pages. + /// List of models. + /// Keeps track of any properties unknown to the library. + internal EndpointModels(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link to the next page constructed using the continuationToken. If null, there are no additional pages. + public string NextLink { get; } + /// List of models. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..4ceab833aebad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownEndpointResourceProperties))] + public partial class EndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + + internal static EndpointResourceProperties DeserializeEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("endpointType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Azure.ContentSafety": return ContentSafetyEndpointResourceProperties.DeserializeContentSafetyEndpointResourceProperties(element, options); + case "Azure.OpenAI": return OpenAIEndpointResourceProperties.DeserializeOpenAIEndpointResourceProperties(element, options); + case "Azure.Speech": return SpeechEndpointResourceProperties.DeserializeSpeechEndpointResourceProperties(element, options); + case "managedOnlineEndpoint": return ManagedOnlineEndpointResourceProperties.DeserializeManagedOnlineEndpointResourceProperties(element, options); + case "serverlessEndpoint": return ServerlessEndpointResourceProperties.DeserializeServerlessEndpointResourceProperties(element, options); + } + } + return UnknownEndpointResourceProperties.DeserializeUnknownEndpointResourceProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs new file mode 100644 index 0000000000000..3c637ddc48a0d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class EndpointResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected EndpointResourceProperties() + { + Deployments = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal EndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) + { + AssociatedResourceId = associatedResourceId; + Deployments = deployments; + EndpointType = endpointType; + EndpointUri = endpointUri; + FailureReason = failureReason; + Location = location; + Name = name; + ProvisioningState = provisioningState; + ShouldCreateAiServicesEndpoint = shouldCreateAiServicesEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Byo resource id for creating the built-in model service endpoints. + public ResourceIdentifier AssociatedResourceId { get; set; } + /// Deployments info. + public IList Deployments { get; } + /// Type of the endpoint. + internal EndpointType EndpointType { get; set; } + /// Uri of the endpoint. + public Uri EndpointUri { get; set; } + /// The failure reason if the creation failed. + public string FailureReason { get; set; } + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + public AzureLocation? Location { get; set; } + /// Name of the endpoint. + public string Name { get; set; } + /// Read-only provision state status property. + public DefaultResourceProvisioningState? ProvisioningState { get; } + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + public bool? ShouldCreateAiServicesEndpoint { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..243169e08d6da --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class EndpointResourcePropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourcePropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static EndpointResourcePropertiesBasicResourceArmPaginatedResult DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointResourcePropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourcePropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..a5c86ae427eee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointResourcePropertiesBasicResourceArmPaginatedResult. + internal partial class EndpointResourcePropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointResourcePropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointResourcePropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs new file mode 100644 index 0000000000000..d021f7f1d0906 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Type of the endpoint. + public readonly partial struct EndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "Azure.OpenAI"; + private const string AzureSpeechValue = "Azure.Speech"; + private const string AzureContentSafetyValue = "Azure.ContentSafety"; + private const string AzureLlamaValue = "Azure.Llama"; + private const string ManagedOnlineEndpointValue = "managedOnlineEndpoint"; + private const string ServerlessEndpointValue = "serverlessEndpoint"; + + /// Azure.OpenAI. + public static EndpointType AzureOpenAI { get; } = new EndpointType(AzureOpenAIValue); + /// Azure.Speech. + public static EndpointType AzureSpeech { get; } = new EndpointType(AzureSpeechValue); + /// Azure.ContentSafety. + public static EndpointType AzureContentSafety { get; } = new EndpointType(AzureContentSafetyValue); + /// Azure.Llama. + public static EndpointType AzureLlama { get; } = new EndpointType(AzureLlamaValue); + /// managedOnlineEndpoint. + public static EndpointType ManagedOnlineEndpoint { get; } = new EndpointType(ManagedOnlineEndpointValue); + /// serverlessEndpoint. + public static EndpointType ServerlessEndpoint { get; } = new EndpointType(ServerlessEndpointValue); + /// Determines if two values are the same. + public static bool operator ==(EndpointType left, EndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EndpointType left, EndpointType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EndpointType(string value) => new EndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EndpointType other && Equals(other); + /// + public bool Equals(EndpointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs deleted file mode 100644 index 6ad3f8896c29c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportFormatType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The format of exported labels. - internal readonly partial struct ExportFormatType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ExportFormatType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DatasetValue = "Dataset"; - private const string CocoValue = "Coco"; - private const string CSVValue = "CSV"; - - /// Dataset. - public static ExportFormatType Dataset { get; } = new ExportFormatType(DatasetValue); - /// Coco. - public static ExportFormatType Coco { get; } = new ExportFormatType(CocoValue); - /// CSV. - public static ExportFormatType CSV { get; } = new ExportFormatType(CSVValue); - /// Determines if two values are the same. - public static bool operator ==(ExportFormatType left, ExportFormatType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ExportFormatType left, ExportFormatType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ExportFormatType(string value) => new ExportFormatType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ExportFormatType other && Equals(other); - /// - public bool Equals(ExportFormatType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs deleted file mode 100644 index 699f8ceaf438b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownExportSummary))] - public partial class ExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ExportSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportSummary(document.RootElement, options); - } - - internal static ExportSummary DeserializeExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("format", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Coco": return CocoExportSummary.DeserializeCocoExportSummary(element, options); - case "CSV": return CsvExportSummary.DeserializeCsvExportSummary(element, options); - case "Dataset": return DatasetExportSummary.DeserializeDatasetExportSummary(element, options); - } - } - return UnknownExportSummary.DeserializeUnknownExportSummary(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{options.Format}' format."); - } - } - - ExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs deleted file mode 100644 index 39a0528891d87..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ExportSummary.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class ExportSummary - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected ExportSummary() - { - } - - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - internal ExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData) - { - EndOn = endOn; - ExportedRowCount = exportedRowCount; - Format = format; - LabelingJobId = labelingJobId; - StartOn = startOn; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The time when the export was completed. - public DateTimeOffset? EndOn { get; } - /// The total number of labeled datapoints exported. - public long? ExportedRowCount { get; } - /// [Required] The format of exported labels, also as the discriminator. - internal ExportFormatType Format { get; set; } - /// Name and identifier of the job containing exported labels. - public string LabelingJobId { get; } - /// The time when the export was requested. - public DateTimeOffset? StartOn { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs index eb98effddb376..23340100c00bd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,26 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) + { + if (FeatureDataTypeOverride != null) + { + writer.WritePropertyName("featureDataTypeOverride"u8); + writer.WriteStartObject(); + foreach (var item in FeatureDataTypeOverride) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("featureDataTypeOverride"); + } + } + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); writer.WritePropertyName("metricThreshold"u8); writer.WriteObjectValue(MetricThreshold, options); writer.WritePropertyName("productionData"u8); @@ -37,10 +57,22 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteEndArray(); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -100,16 +132,38 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib { return null; } + IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; FeatureAttributionMetricThreshold metricThreshold = default; IList productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } + if (property.NameEquals("featureImportanceSettings"u8)) + { + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("metricThreshold"u8)) { metricThreshold = FeatureAttributionMetricThreshold.DeserializeFeatureAttributionMetricThreshold(property.Value, options); @@ -130,13 +184,19 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -166,10 +226,12 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib } serializedAdditionalRawData = rawDataDictionary; return new FeatureAttributionDriftMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, + featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, metricThreshold, productionData, referenceData); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs index 154b1dc047da9..dcb53dc2ddd02 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs @@ -15,24 +15,28 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class FeatureAttributionDriftMonitoringSignal : MonitoringSignalBase { /// Initializes a new instance of . + /// [Required] The settings for computing feature importance. /// [Required] A list of metrics to calculate and their associated thresholds. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - /// , or is null. - public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) + /// , , or is null. + public FeatureAttributionDriftMonitoringSignal(FeatureImportanceSettings featureImportanceSettings, FeatureAttributionMetricThreshold metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) { + Argument.AssertNotNull(featureImportanceSettings, nameof(featureImportanceSettings)); Argument.AssertNotNull(metricThreshold, nameof(metricThreshold)); Argument.AssertNotNull(productionData, nameof(productionData)); Argument.AssertNotNull(referenceData, nameof(referenceData)); + FeatureDataTypeOverride = new ChangeTrackingDictionary(); + FeatureImportanceSettings = featureImportanceSettings; MetricThreshold = metricThreshold; ProductionData = productionData.ToList(); ReferenceData = referenceData; @@ -40,23 +44,27 @@ public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. + /// A dictionary that maps feature names to their respective data types. + /// [Required] The settings for computing feature importance. /// [Required] A list of metrics to calculate and their associated thresholds. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal FeatureAttributionDriftMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, FeatureAttributionMetricThreshold metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal FeatureAttributionDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, FeatureAttributionMetricThreshold metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { + FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; MetricThreshold = metricThreshold; ProductionData = productionData; ReferenceData = referenceData; @@ -68,18 +76,22 @@ internal FeatureAttributionDriftMonitoringSignal() { } + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } + /// [Required] The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// [Required] A list of metrics to calculate and their associated thresholds. public FeatureAttributionMetricThreshold MetricThreshold { get; set; } /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public IList ProductionData { get; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs new file mode 100644 index 0000000000000..b840b6d136074 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The mode of operation for computing feature importance. + public readonly partial struct FeatureImportanceMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FeatureImportanceMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisabledValue = "Disabled"; + private const string EnabledValue = "Enabled"; + + /// Disables computing feature importance within a signal. + public static FeatureImportanceMode Disabled { get; } = new FeatureImportanceMode(DisabledValue); + /// Enables computing feature importance within a signal. + public static FeatureImportanceMode Enabled { get; } = new FeatureImportanceMode(EnabledValue); + /// Determines if two values are the same. + public static bool operator ==(FeatureImportanceMode left, FeatureImportanceMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FeatureImportanceMode left, FeatureImportanceMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FeatureImportanceMode(string value) => new FeatureImportanceMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FeatureImportanceMode other && Equals(other); + /// + public bool Equals(FeatureImportanceMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.Serialization.cs index 969a550a7413e..4a144c8d5e565 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.Serialization.cs @@ -13,36 +13,36 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingDataConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class FeatureImportanceSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(DataId)) + if (Optional.IsDefined(Mode)) { - if (DataId != null) + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(TargetColumn)) + { + if (TargetColumn != null) { - writer.WritePropertyName("dataId"u8); - writer.WriteStringValue(DataId); + writer.WritePropertyName("targetColumn"u8); + writer.WriteStringValue(TargetColumn); } else { - writer.WriteNull("dataId"); + writer.WriteNull("targetColumn"); } } - if (Optional.IsDefined(IncrementalDataRefresh)) - { - writer.WritePropertyName("incrementalDataRefresh"u8); - writer.WriteStringValue(IncrementalDataRefresh.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -61,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - LabelingDataConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FeatureImportanceSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingDataConfiguration(document.RootElement, options); + return DeserializeFeatureImportanceSettings(document.RootElement, options); } - internal static LabelingDataConfiguration DeserializeLabelingDataConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static FeatureImportanceSettings DeserializeFeatureImportanceSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,29 +81,29 @@ internal static LabelingDataConfiguration DeserializeLabelingDataConfiguration(J { return null; } - string dataId = default; - IncrementalDataRefresh? incrementalDataRefresh = default; + FeatureImportanceMode? mode = default; + string targetColumn = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("dataId"u8)) + if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - dataId = null; continue; } - dataId = property.Value.GetString(); + mode = new FeatureImportanceMode(property.Value.GetString()); continue; } - if (property.NameEquals("incrementalDataRefresh"u8)) + if (property.NameEquals("targetColumn"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + targetColumn = null; continue; } - incrementalDataRefresh = new IncrementalDataRefresh(property.Value.GetString()); + targetColumn = property.Value.GetString(); continue; } if (options.Format != "W") @@ -112,38 +112,38 @@ internal static LabelingDataConfiguration DeserializeLabelingDataConfiguration(J } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingDataConfiguration(dataId, incrementalDataRefresh, serializedAdditionalRawData); + return new FeatureImportanceSettings(mode, targetColumn, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support writing '{options.Format}' format."); } } - LabelingDataConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FeatureImportanceSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingDataConfiguration(document.RootElement, options); + return DeserializeFeatureImportanceSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingDataConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeatureImportanceSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.cs similarity index 63% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.cs index b45f10eaa078c..85b46a3e04a4c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetJobArmPaginatedResult.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureImportanceSettings.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// A paginated list of FeaturesetJob entities. - internal partial class FeaturesetJobArmPaginatedResult + /// The FeatureImportanceSettings. + public partial class FeatureImportanceSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class FeaturesetJobArmPaginatedResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal FeaturesetJobArmPaginatedResult() + /// Initializes a new instance of . + public FeatureImportanceSettings() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The link to the next page of FeaturesetJob objects. If null, there are no additional pages. - /// An array of objects of type FeaturesetJob. + /// Initializes a new instance of . + /// The mode of operation for computing feature importance. + /// The name of the target column within the input data asset. /// Keeps track of any properties unknown to the library. - internal FeaturesetJobArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal FeatureImportanceSettings(FeatureImportanceMode? mode, string targetColumn, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; - Value = value; + Mode = mode; + TargetColumn = targetColumn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link to the next page of FeaturesetJob objects. If null, there are no additional pages. - public string NextLink { get; } - /// An array of objects of type FeaturesetJob. - public IReadOnlyList Value { get; } + /// The mode of operation for computing feature importance. + public FeatureImportanceMode? Mode { get; set; } + /// The name of the target column within the input data asset. + public string TargetColumn { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs index 0d6ec75135901..7c0410b0d6063 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs @@ -26,6 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DataAvailabilityStatus)) + { + writer.WritePropertyName("dataAvailabilityStatus"u8); + writer.WriteStartArray(); + foreach (var item in DataAvailabilityStatus) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); @@ -48,6 +58,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteNull("featureWindow"); } } + if (Optional.IsDefined(JobId)) + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } if (Optional.IsDefined(Resource)) { writer.WritePropertyName("resource"u8); @@ -113,9 +139,12 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac { return null; } + IList dataAvailabilityStatus = default; string description = default; string displayName = default; FeatureWindow featureWindow = default; + string jobId = default; + IDictionary properties = default; MaterializationComputeResource resource = default; IDictionary sparkConfiguration = default; IDictionary tags = default; @@ -123,6 +152,20 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("dataAvailabilityStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new DataAvailabilityStatus(item.GetString())); + } + dataAvailabilityStatus = array; + continue; + } if (property.NameEquals("description"u8)) { description = property.Value.GetString(); @@ -143,6 +186,25 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac featureWindow = FeatureWindow.DeserializeFeatureWindow(property.Value, options); continue; } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + properties = dictionary; + continue; + } if (property.NameEquals("resource"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -187,9 +249,12 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac } serializedAdditionalRawData = rawDataDictionary; return new FeatureSetVersionBackfillContent( + dataAvailabilityStatus ?? new ChangeTrackingList(), description, displayName, featureWindow, + jobId, + properties ?? new ChangeTrackingDictionary(), resource, sparkConfiguration ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs index c597a4276467a..fcc75358704ff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs @@ -48,35 +48,49 @@ public partial class FeatureSetVersionBackfillContent /// Initializes a new instance of . public FeatureSetVersionBackfillContent() { + DataAvailabilityStatus = new ChangeTrackingList(); + Properties = new ChangeTrackingDictionary(); SparkConfiguration = new ChangeTrackingDictionary(); Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . + /// Specified the data availability status that you want to backfill. /// Specifies description. /// Specifies description. /// Specifies the backfill feature window to be materialized. + /// Specify the jobId to retry the failed materialization. + /// Specifies the properties. /// Specifies the compute resource settings. /// Specifies the spark compute settings. /// Specifies the tags. /// Keeps track of any properties unknown to the library. - internal FeatureSetVersionBackfillContent(string description, string displayName, FeatureWindow featureWindow, MaterializationComputeResource resource, IDictionary sparkConfiguration, IDictionary tags, IDictionary serializedAdditionalRawData) + internal FeatureSetVersionBackfillContent(IList dataAvailabilityStatus, string description, string displayName, FeatureWindow featureWindow, string jobId, IDictionary properties, MaterializationComputeResource resource, IDictionary sparkConfiguration, IDictionary tags, IDictionary serializedAdditionalRawData) { + DataAvailabilityStatus = dataAvailabilityStatus; Description = description; DisplayName = displayName; FeatureWindow = featureWindow; + JobId = jobId; + Properties = properties; Resource = resource; SparkConfiguration = sparkConfiguration; Tags = tags; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Specified the data availability status that you want to backfill. + public IList DataAvailabilityStatus { get; } /// Specifies description. public string Description { get; set; } /// Specifies description. public string DisplayName { get; set; } /// Specifies the backfill feature window to be materialized. public FeatureWindow FeatureWindow { get; set; } + /// Specify the jobId to retry the failed materialization. + public string JobId { get; set; } + /// Specifies the properties. + public IDictionary Properties { get; } /// Specifies the compute resource settings. internal MaterializationComputeResource Resource { get; set; } /// Specifies the instance type. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs deleted file mode 100644 index 9c259b82a03d2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureStoreJobType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The FeatureStoreJobType. - public readonly partial struct FeatureStoreJobType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public FeatureStoreJobType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RecurrentMaterializationValue = "RecurrentMaterialization"; - private const string BackfillMaterializationValue = "BackfillMaterialization"; - - /// RecurrentMaterialization. - public static FeatureStoreJobType RecurrentMaterialization { get; } = new FeatureStoreJobType(RecurrentMaterializationValue); - /// BackfillMaterialization. - public static FeatureStoreJobType BackfillMaterialization { get; } = new FeatureStoreJobType(BackfillMaterializationValue); - /// Determines if two values are the same. - public static bool operator ==(FeatureStoreJobType left, FeatureStoreJobType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(FeatureStoreJobType left, FeatureStoreJobType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator FeatureStoreJobType(string value) => new FeatureStoreJobType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is FeatureStoreJobType other && Equals(other); - /// - public bool Equals(FeatureStoreJobType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs index 31e98f69af0a8..9a6e09d8b65c6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetSpecification.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing specification. + /// DTO object representing specification. internal partial class FeaturesetSpecification { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs similarity index 51% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs index 5a50d95cf2763..43bf1bb0259d0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs @@ -13,33 +13,36 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class KerberosKeytabSecrets : IUtf8JsonSerializable, IJsonModel + public partial class FeaturesetVersionBackfillResponse : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(KerberosKeytab)) + if (Optional.IsCollectionDefined(JobIds)) { - if (KerberosKeytab != null) + if (JobIds != null) { - writer.WritePropertyName("kerberosKeytab"u8); - writer.WriteStringValue(KerberosKeytab); + writer.WritePropertyName("jobIds"u8); + writer.WriteStartArray(); + foreach (var item in JobIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } else { - writer.WriteNull("kerberosKeytab"); + writer.WriteNull("jobIds"); } } - writer.WritePropertyName("secretsType"u8); - writer.WriteStringValue(SecretsType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - KerberosKeytabSecrets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FeaturesetVersionBackfillResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosKeytabSecrets(document.RootElement, options); + return DeserializeFeaturesetVersionBackfillResponse(document.RootElement, options); } - internal static KerberosKeytabSecrets DeserializeKerberosKeytabSecrets(JsonElement element, ModelReaderWriterOptions options = null) + internal static FeaturesetVersionBackfillResponse DeserializeFeaturesetVersionBackfillResponse(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +81,24 @@ internal static KerberosKeytabSecrets DeserializeKerberosKeytabSecrets(JsonEleme { return null; } - string kerberosKeytab = default; - SecretsType secretsType = default; + IReadOnlyList jobIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kerberosKeytab"u8)) + if (property.NameEquals("jobIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - kerberosKeytab = null; + jobIds = null; continue; } - kerberosKeytab = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretsType"u8)) - { - secretsType = new SecretsType(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + jobIds = array; continue; } if (options.Format != "W") @@ -105,38 +107,38 @@ internal static KerberosKeytabSecrets DeserializeKerberosKeytabSecrets(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new KerberosKeytabSecrets(secretsType, serializedAdditionalRawData, kerberosKeytab); + return new FeaturesetVersionBackfillResponse(jobIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support writing '{options.Format}' format."); } } - KerberosKeytabSecrets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FeaturesetVersionBackfillResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosKeytabSecrets(document.RootElement, options); + return DeserializeFeaturesetVersionBackfillResponse(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(KerberosKeytabSecrets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs new file mode 100644 index 0000000000000..11e2aad38a10b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Response payload for creating a backfill request for a given feature set version. + public partial class FeaturesetVersionBackfillResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FeaturesetVersionBackfillResponse() + { + JobIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of jobs submitted as part of the backfill request. + /// Keeps track of any properties unknown to the library. + internal FeaturesetVersionBackfillResponse(IReadOnlyList jobIds, IDictionary serializedAdditionalRawData) + { + JobIds = jobIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of jobs submitted as part of the backfill request. + public IReadOnlyList JobIds { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs deleted file mode 100644 index f831cc1ff61af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FileSystemSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The FileSystemSource. - public partial class FileSystemSource : DataImportSource - { - /// Initializes a new instance of . - public FileSystemSource() - { - SourceType = DataImportSourceType.FileSystem; - } - - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. - /// Keeps track of any properties unknown to the library. - /// Path on data import FileSystem source. - internal FileSystemSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData, string path) : base(connection, sourceType, serializedAdditionalRawData) - { - Path = path; - SourceType = sourceType; - } - - /// Path on data import FileSystem source. - public string Path { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs index ffaeba6ecbf2d..82961ef25abaf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs @@ -13,129 +13,46 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingJobProperties : IUtf8JsonSerializable, IJsonModel + public partial class FineTuningJob : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + writer.WritePropertyName("fineTuningDetails"u8); + writer.WriteObjectValue(FineTuningDetails, options); + if (Optional.IsDefined(Resources)) { - if (CreatedOn != null) - { - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - else - { - writer.WriteNull("createdDateTime"); - } + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); } - if (Optional.IsDefined(DataConfiguration)) + if (Optional.IsDefined(QueueSettings)) { - if (DataConfiguration != null) + if (QueueSettings != null) { - writer.WritePropertyName("dataConfiguration"u8); - writer.WriteObjectValue(DataConfiguration, options); + writer.WritePropertyName("queueSettings"u8); + writer.WriteObjectValue(QueueSettings, options); } else { - writer.WriteNull("dataConfiguration"); + writer.WriteNull("queueSettings"); } } - if (Optional.IsDefined(JobInstructions)) - { - if (JobInstructions != null) - { - writer.WritePropertyName("jobInstructions"u8); - writer.WriteObjectValue(JobInstructions, options); - } - else - { - writer.WriteNull("jobInstructions"); - } - } - if (Optional.IsCollectionDefined(LabelCategories)) - { - if (LabelCategories != null) - { - writer.WritePropertyName("labelCategories"u8); - writer.WriteStartObject(); - foreach (var item in LabelCategories) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("labelCategories"); - } - } - if (Optional.IsDefined(LabelingJobMediaProperties)) - { - if (LabelingJobMediaProperties != null) - { - writer.WritePropertyName("labelingJobMediaProperties"u8); - writer.WriteObjectValue(LabelingJobMediaProperties, options); - } - else - { - writer.WriteNull("labelingJobMediaProperties"); - } - } - if (Optional.IsDefined(MlAssistConfiguration)) - { - writer.WritePropertyName("mlAssistConfiguration"u8); - writer.WriteObjectValue(MlAssistConfiguration, options); - } - if (options.Format != "W" && Optional.IsDefined(ProgressMetrics)) - { - if (ProgressMetrics != null) - { - writer.WritePropertyName("progressMetrics"u8); - writer.WriteObjectValue(ProgressMetrics, options); - } - else - { - writer.WriteNull("progressMetrics"); - } - } - if (options.Format != "W" && Optional.IsDefined(ProjectId)) - { - writer.WritePropertyName("projectId"u8); - writer.WriteStringValue(ProjectId.Value); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(StatusMessages)) + writer.WritePropertyName("outputs"u8); + writer.WriteStartObject(); + foreach (var item in Outputs) { - if (StatusMessages != null) - { - writer.WritePropertyName("statusMessages"u8); - writer.WriteStartArray(); - foreach (var item in StatusMessages) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("statusMessages"); - } + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); } + writer.WriteEndObject(); if (Optional.IsDefined(ComponentId)) { if (ComponentId != null) @@ -208,24 +125,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -315,19 +214,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - LabelingJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FineTuningJob IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobProperties(document.RootElement, options); + return DeserializeFineTuningJob(document.RootElement, options); } - internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static FineTuningJob DeserializeFineTuningJob(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -335,16 +234,10 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme { return null; } - DateTimeOffset? createdDateTime = default; - LabelingDataConfiguration dataConfiguration = default; - LabelingJobInstructions jobInstructions = default; - IDictionary labelCategories = default; - LabelingJobMediaProperties labelingJobMediaProperties = default; - MachineLearningAssistConfiguration mlAssistConfiguration = default; - ProgressMetrics progressMetrics = default; - Guid? projectId = default; - JobProvisioningState? provisioningState = default; - IReadOnlyList statusMessages = default; + FineTuningVertical fineTuningDetails = default; + JobResources resources = default; + JobQueueSettings queueSettings = default; + IDictionary outputs = default; ResourceIdentifier componentId = default; ResourceIdentifier computeId = default; string displayName = default; @@ -353,7 +246,6 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -363,111 +255,38 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("createdDateTime"u8)) + if (property.NameEquals("fineTuningDetails"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - createdDateTime = null; - continue; - } - createdDateTime = property.Value.GetDateTimeOffset("O"); + fineTuningDetails = FineTuningVertical.DeserializeFineTuningVertical(property.Value, options); continue; } - if (property.NameEquals("dataConfiguration"u8)) + if (property.NameEquals("resources"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - dataConfiguration = null; continue; } - dataConfiguration = LabelingDataConfiguration.DeserializeLabelingDataConfiguration(property.Value, options); + resources = JobResources.DeserializeJobResources(property.Value, options); continue; } - if (property.NameEquals("jobInstructions"u8)) + if (property.NameEquals("queueSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - jobInstructions = null; + queueSettings = null; continue; } - jobInstructions = LabelingJobInstructions.DeserializeLabelingJobInstructions(property.Value, options); + queueSettings = JobQueueSettings.DeserializeJobQueueSettings(property.Value, options); continue; } - if (property.NameEquals("labelCategories"u8)) + if (property.NameEquals("outputs"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelCategories = null; - continue; - } - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, LabelCategory.DeserializeLabelCategory(property0.Value, options)); - } - labelCategories = dictionary; - continue; - } - if (property.NameEquals("labelingJobMediaProperties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobMediaProperties = null; - continue; - } - labelingJobMediaProperties = LabelingJobMediaProperties.DeserializeLabelingJobMediaProperties(property.Value, options); - continue; - } - if (property.NameEquals("mlAssistConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mlAssistConfiguration = MachineLearningAssistConfiguration.DeserializeMachineLearningAssistConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("progressMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - progressMetrics = null; - continue; - } - progressMetrics = ProgressMetrics.DeserializeProgressMetrics(property.Value, options); - continue; - } - if (property.NameEquals("projectId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - projectId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new JobProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("statusMessages"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - statusMessages = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JobStatusMessage.DeserializeJobStatusMessage(item, options)); + dictionary.Add(property0.Name, MachineLearningJobOutput.DeserializeMachineLearningJobOutput(property0.Value, options)); } - statusMessages = array; + outputs = dictionary; continue; } if (property.NameEquals("componentId"u8)) @@ -539,21 +358,6 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -624,7 +428,7 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobProperties( + return new FineTuningJob( description, properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), @@ -637,50 +441,43 @@ internal static LabelingJobProperties DeserializeLabelingJobProperties(JsonEleme isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, - createdDateTime, - dataConfiguration, - jobInstructions, - labelCategories ?? new ChangeTrackingDictionary(), - labelingJobMediaProperties, - mlAssistConfiguration, - progressMetrics, - projectId, - provisioningState, - statusMessages ?? new ChangeTrackingList()); + fineTuningDetails, + resources, + queueSettings, + outputs); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support writing '{options.Format}' format."); } } - LabelingJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FineTuningJob IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobProperties(document.RootElement, options); + return DeserializeFineTuningJob(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FineTuningJob)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs new file mode 100644 index 0000000000000..f18a5f65c7684 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// FineTuning Job definition. + public partial class FineTuningJob : MachineLearningJobProperties + { + /// Initializes a new instance of . + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// or is null. + public FineTuningJob(FineTuningVertical fineTuningDetails, IDictionary outputs) + { + Argument.AssertNotNull(fineTuningDetails, nameof(fineTuningDetails)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + FineTuningDetails = fineTuningDetails; + Outputs = outputs; + JobType = JobType.FineTuning; + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// [Required] Specifies the type of job. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Instance types and other resources for the job. + /// Queue settings for the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + internal FineTuningJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, FineTuningVertical fineTuningDetails, JobResources resources, JobQueueSettings queueSettings, IDictionary outputs) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) + { + FineTuningDetails = fineTuningDetails; + Resources = resources; + QueueSettings = queueSettings; + Outputs = outputs; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal FineTuningJob() + { + } + + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public FineTuningVertical FineTuningDetails { get; set; } + /// Instance types and other resources for the job. + internal JobResources Resources { get; set; } + /// List of instance types to choose from. + public IList ResourcesInstanceTypes + { + get + { + if (Resources is null) + Resources = new JobResources(); + return Resources.InstanceTypes; + } + } + + /// Queue settings for the job. + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + public IDictionary Outputs { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs new file mode 100644 index 0000000000000..d4dea3c5db188 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The FineTuningTaskType. + public readonly partial struct FineTuningTaskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FineTuningTaskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ChatCompletionValue = "ChatCompletion"; + private const string TextCompletionValue = "TextCompletion"; + private const string TextClassificationValue = "TextClassification"; + private const string QuestionAnsweringValue = "QuestionAnswering"; + private const string TextSummarizationValue = "TextSummarization"; + private const string TokenClassificationValue = "TokenClassification"; + private const string TextTranslationValue = "TextTranslation"; + private const string ImageClassificationValue = "ImageClassification"; + private const string ImageInstanceSegmentationValue = "ImageInstanceSegmentation"; + private const string ImageObjectDetectionValue = "ImageObjectDetection"; + private const string VideoMultiObjectTrackingValue = "VideoMultiObjectTracking"; + + /// ChatCompletion. + public static FineTuningTaskType ChatCompletion { get; } = new FineTuningTaskType(ChatCompletionValue); + /// TextCompletion. + public static FineTuningTaskType TextCompletion { get; } = new FineTuningTaskType(TextCompletionValue); + /// TextClassification. + public static FineTuningTaskType TextClassification { get; } = new FineTuningTaskType(TextClassificationValue); + /// QuestionAnswering. + public static FineTuningTaskType QuestionAnswering { get; } = new FineTuningTaskType(QuestionAnsweringValue); + /// TextSummarization. + public static FineTuningTaskType TextSummarization { get; } = new FineTuningTaskType(TextSummarizationValue); + /// TokenClassification. + public static FineTuningTaskType TokenClassification { get; } = new FineTuningTaskType(TokenClassificationValue); + /// TextTranslation. + public static FineTuningTaskType TextTranslation { get; } = new FineTuningTaskType(TextTranslationValue); + /// ImageClassification. + public static FineTuningTaskType ImageClassification { get; } = new FineTuningTaskType(ImageClassificationValue); + /// ImageInstanceSegmentation. + public static FineTuningTaskType ImageInstanceSegmentation { get; } = new FineTuningTaskType(ImageInstanceSegmentationValue); + /// ImageObjectDetection. + public static FineTuningTaskType ImageObjectDetection { get; } = new FineTuningTaskType(ImageObjectDetectionValue); + /// VideoMultiObjectTracking. + public static FineTuningTaskType VideoMultiObjectTracking { get; } = new FineTuningTaskType(VideoMultiObjectTrackingValue); + /// Determines if two values are the same. + public static bool operator ==(FineTuningTaskType left, FineTuningTaskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FineTuningTaskType left, FineTuningTaskType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FineTuningTaskType(string value) => new FineTuningTaskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FineTuningTaskType other && Equals(other); + /// + public bool Equals(FineTuningTaskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs new file mode 100644 index 0000000000000..eea74c37f607b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownFineTuningVertical))] + public partial class FineTuningVertical : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningVertical IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningVertical(document.RootElement, options); + } + + internal static FineTuningVertical DeserializeFineTuningVertical(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("modelProvider", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzureOpenAI": return AzureOpenAiFineTuning.DeserializeAzureOpenAiFineTuning(element, options); + case "Custom": return CustomModelFineTuning.DeserializeCustomModelFineTuning(element, options); + } + } + return UnknownFineTuningVertical.DeserializeUnknownFineTuningVertical(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{options.Format}' format."); + } + } + + FineTuningVertical IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningVertical(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs new file mode 100644 index 0000000000000..1e159dda8452b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class FineTuningVertical + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// or is null. + protected FineTuningVertical(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + TaskType = taskType; + TrainingData = trainingData; + Model = model; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + internal FineTuningVertical(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData) + { + ModelProvider = modelProvider; + TaskType = taskType; + TrainingData = trainingData; + ValidationData = validationData; + Model = model; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FineTuningVertical() + { + } + + /// [Required] Enum to determine the type of fine tuning. + internal ModelProvider ModelProvider { get; set; } + /// [Required] Fine tuning task type. + public FineTuningTaskType TaskType { get; set; } + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public MachineLearningJobInput TrainingData { get; set; } + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public MachineLearningJobInput ValidationData { get; set; } + /// [Required] Input model for fine tuning. + public MachineLearningFlowModelJobInput Model { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs index 813b2f098fa16..3c796cd0ff8d8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingModel.cs @@ -93,7 +93,7 @@ public ForecastingModel(string value) public static ForecastingModel SGD { get; } = new ForecastingModel(SGDValue); /// /// Random forest is a supervised learning algorithm. - /// The "forest" it builds, is an ensemble of decision trees, usually trained with the bagging method. + /// The "forest" it builds, is an ensemble of decision trees, usually trained with the “bagging” method. /// The general idea of the bagging method is that a combination of learning models increases the overall result. /// public static ForecastingModel RandomForest { get; } = new ForecastingModel(RandomForestValue); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs index 452c9bf4c13a2..63d4631f965de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs @@ -55,23 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("featureLags"u8); writer.WriteStringValue(FeatureLags.Value.ToString()); } - if (Optional.IsCollectionDefined(FeaturesUnknownAtForecastTime)) - { - if (FeaturesUnknownAtForecastTime != null) - { - writer.WritePropertyName("featuresUnknownAtForecastTime"u8); - writer.WriteStartArray(); - foreach (var item in FeaturesUnknownAtForecastTime) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("featuresUnknownAtForecastTime"); - } - } if (Optional.IsDefined(ForecastHorizon)) { writer.WritePropertyName("forecastHorizon"u8); @@ -203,7 +186,6 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e string countryOrRegionForHolidays = default; int? cvStepSize = default; MachineLearningFeatureLag? featureLags = default; - IList featuresUnknownAtForecastTime = default; ForecastHorizon forecastHorizon = default; string frequency = default; ForecastingSeasonality seasonality = default; @@ -247,21 +229,6 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e featureLags = new MachineLearningFeatureLag(property.Value.GetString()); continue; } - if (property.NameEquals("featuresUnknownAtForecastTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - featuresUnknownAtForecastTime = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - featuresUnknownAtForecastTime = array; - continue; - } if (property.NameEquals("forecastHorizon"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -372,7 +339,6 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e countryOrRegionForHolidays, cvStepSize, featureLags, - featuresUnknownAtForecastTime ?? new ChangeTrackingList(), forecastHorizon, frequency, seasonality, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs index 0b02dffa468d3..27a0f5bc4046f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs @@ -48,7 +48,6 @@ public partial class ForecastingSettings /// Initializes a new instance of . public ForecastingSettings() { - FeaturesUnknownAtForecastTime = new ChangeTrackingList(); TimeSeriesIdColumnNames = new ChangeTrackingList(); } @@ -63,10 +62,6 @@ public ForecastingSettings() /// three days apart. /// /// Flag for generating lags for the numeric features with 'auto' or null. - /// - /// The feature columns that are available for training but unknown at the time of forecast/inference. - /// If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are known at inference time. - /// /// /// The desired maximum forecast horizon in units of time-series frequency. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -101,12 +96,11 @@ public ForecastingSettings() /// /// Configure STL Decomposition of the time-series target column. /// Keeps track of any properties unknown to the library. - internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, MachineLearningFeatureLag? featureLags, IList featuresUnknownAtForecastTime, ForecastHorizon forecastHorizon, string frequency, ForecastingSeasonality seasonality, MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig, TargetAggregationFunction? targetAggregateFunction, TargetLags targetLags, TargetRollingWindowSize targetRollingWindowSize, string timeColumnName, IList timeSeriesIdColumnNames, MachineLearningUseStl? useStl, IDictionary serializedAdditionalRawData) + internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, MachineLearningFeatureLag? featureLags, ForecastHorizon forecastHorizon, string frequency, ForecastingSeasonality seasonality, MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig, TargetAggregationFunction? targetAggregateFunction, TargetLags targetLags, TargetRollingWindowSize targetRollingWindowSize, string timeColumnName, IList timeSeriesIdColumnNames, MachineLearningUseStl? useStl, IDictionary serializedAdditionalRawData) { CountryOrRegionForHolidays = countryOrRegionForHolidays; CvStepSize = cvStepSize; FeatureLags = featureLags; - FeaturesUnknownAtForecastTime = featuresUnknownAtForecastTime; ForecastHorizon = forecastHorizon; Frequency = frequency; Seasonality = seasonality; @@ -134,11 +128,6 @@ internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, /// Flag for generating lags for the numeric features with 'auto' or null. public MachineLearningFeatureLag? FeatureLags { get; set; } /// - /// The feature columns that are available for training but unknown at the time of forecast/inference. - /// If features_unknown_at_forecast_time is not set, it is assumed that all the feature columns in the dataset are known at inference time. - /// - public IList FeaturesUnknownAtForecastTime { get; set; } - /// /// The desired maximum forecast horizon in units of time-series frequency. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs index a9cfe765a311c..dd2012704c136 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs @@ -102,11 +102,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -154,7 +149,6 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -253,15 +247,6 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -276,7 +261,6 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs index b38e7abaced17..54164528aa3f9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs @@ -31,15 +31,10 @@ public ForecastingTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. /// Allowed models for forecasting task. /// Blocked models for forecasting task. - internal ForecastingTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, trainingMode, serializedAdditionalRawData) + internal ForecastingTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs index 140c0f591f36e..092782e3911c1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs @@ -36,6 +36,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -83,6 +93,7 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element } string destination = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -103,6 +114,20 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -123,7 +148,13 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new FqdnOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new FqdnOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs index 77d3b297e501c..2e894cb2e3b49 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs @@ -21,11 +21,12 @@ public FqdnOutboundRule() /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// - internal FqdnOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, string destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal FqdnOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, string destination) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; OutboundRuleType = outboundRuleType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs deleted file mode 100644 index b3c88274f1403..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetric.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation safety quality metric enum. - public readonly partial struct GenerationSafetyQualityMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GenerationSafetyQualityMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AcceptableGroundednessScorePerInstanceValue = "AcceptableGroundednessScorePerInstance"; - private const string AggregatedGroundednessPassRateValue = "AggregatedGroundednessPassRate"; - private const string AcceptableCoherenceScorePerInstanceValue = "AcceptableCoherenceScorePerInstance"; - private const string AggregatedCoherencePassRateValue = "AggregatedCoherencePassRate"; - private const string AcceptableFluencyScorePerInstanceValue = "AcceptableFluencyScorePerInstance"; - private const string AggregatedFluencyPassRateValue = "AggregatedFluencyPassRate"; - private const string AcceptableSimilarityScorePerInstanceValue = "AcceptableSimilarityScorePerInstance"; - private const string AggregatedSimilarityPassRateValue = "AggregatedSimilarityPassRate"; - private const string AcceptableRelevanceScorePerInstanceValue = "AcceptableRelevanceScorePerInstance"; - private const string AggregatedRelevancePassRateValue = "AggregatedRelevancePassRate"; - - /// AcceptableGroundednessScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableGroundednessScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableGroundednessScorePerInstanceValue); - /// AggregatedGroundednessPassRate. - public static GenerationSafetyQualityMetric AggregatedGroundednessPassRate { get; } = new GenerationSafetyQualityMetric(AggregatedGroundednessPassRateValue); - /// AcceptableCoherenceScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableCoherenceScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableCoherenceScorePerInstanceValue); - /// AggregatedCoherencePassRate. - public static GenerationSafetyQualityMetric AggregatedCoherencePassRate { get; } = new GenerationSafetyQualityMetric(AggregatedCoherencePassRateValue); - /// AcceptableFluencyScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableFluencyScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableFluencyScorePerInstanceValue); - /// AggregatedFluencyPassRate. - public static GenerationSafetyQualityMetric AggregatedFluencyPassRate { get; } = new GenerationSafetyQualityMetric(AggregatedFluencyPassRateValue); - /// AcceptableSimilarityScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableSimilarityScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableSimilarityScorePerInstanceValue); - /// AggregatedSimilarityPassRate. - public static GenerationSafetyQualityMetric AggregatedSimilarityPassRate { get; } = new GenerationSafetyQualityMetric(AggregatedSimilarityPassRateValue); - /// AcceptableRelevanceScorePerInstance. - public static GenerationSafetyQualityMetric AcceptableRelevanceScorePerInstance { get; } = new GenerationSafetyQualityMetric(AcceptableRelevanceScorePerInstanceValue); - /// AggregatedRelevancePassRate. - public static GenerationSafetyQualityMetric AggregatedRelevancePassRate { get; } = new GenerationSafetyQualityMetric(AggregatedRelevancePassRateValue); - /// Determines if two values are the same. - public static bool operator ==(GenerationSafetyQualityMetric left, GenerationSafetyQualityMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GenerationSafetyQualityMetric left, GenerationSafetyQualityMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GenerationSafetyQualityMetric(string value) => new GenerationSafetyQualityMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GenerationSafetyQualityMetric other && Equals(other); - /// - public bool Equals(GenerationSafetyQualityMetric other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs deleted file mode 100644 index 19cb3eb195c70..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation safety quality metric threshold definition. - public partial class GenerationSafetyQualityMetricThreshold - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationSafetyQualityMetricThreshold(GenerationSafetyQualityMetric metric) - { - Metric = metric; - } - - /// Initializes a new instance of . - /// [Required] Gets or sets the feature attribution metric to calculate. - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - /// Keeps track of any properties unknown to the library. - internal GenerationSafetyQualityMetricThreshold(GenerationSafetyQualityMetric metric, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) - { - Metric = metric; - Threshold = threshold; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GenerationSafetyQualityMetricThreshold() - { - } - - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationSafetyQualityMetric Metric { get; set; } - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - internal MonitoringThreshold Threshold { get; set; } - /// The threshold value. If null, the set default is dependent on the metric type. - public double? ThresholdValue - { - get => Threshold is null ? default : Threshold.Value; - set - { - if (Threshold is null) - Threshold = new MonitoringThreshold(); - Threshold.Value = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs deleted file mode 100644 index 4bf3c28900b30..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.Serialization.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class GenerationSafetyQualityMonitoringSignal : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metricThresholds"u8); - writer.WriteStartArray(); - foreach (var item in MetricThresholds) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsCollectionDefined(ProductionData)) - { - if (ProductionData != null) - { - writer.WritePropertyName("productionData"u8); - writer.WriteStartArray(); - foreach (var item in ProductionData) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("productionData"); - } - } - writer.WritePropertyName("samplingRate"u8); - writer.WriteNumberValue(SamplingRate); - if (Optional.IsDefined(WorkspaceConnectionId)) - { - if (WorkspaceConnectionId != null) - { - writer.WritePropertyName("workspaceConnectionId"u8); - writer.WriteStringValue(WorkspaceConnectionId); - } - else - { - writer.WriteNull("workspaceConnectionId"); - } - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - writer.WritePropertyName("signalType"u8); - writer.WriteStringValue(SignalType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GenerationSafetyQualityMonitoringSignal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationSafetyQualityMonitoringSignal(document.RootElement, options); - } - - internal static GenerationSafetyQualityMonitoringSignal DeserializeGenerationSafetyQualityMonitoringSignal(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList metricThresholds = default; - IList productionData = default; - double samplingRate = default; - string workspaceConnectionId = default; - MonitoringNotificationMode? mode = default; - IDictionary properties = default; - MonitoringSignalType signalType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricThresholds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GenerationSafetyQualityMetricThreshold.DeserializeGenerationSafetyQualityMetricThreshold(item, options)); - } - metricThresholds = array; - continue; - } - if (property.NameEquals("productionData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - productionData = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MonitoringInputDataBase.DeserializeMonitoringInputDataBase(item, options)); - } - productionData = array; - continue; - } - if (property.NameEquals("samplingRate"u8)) - { - samplingRate = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("workspaceConnectionId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - workspaceConnectionId = null; - continue; - } - workspaceConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new MonitoringNotificationMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("signalType"u8)) - { - signalType = new MonitoringSignalType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GenerationSafetyQualityMonitoringSignal( - mode, - properties ?? new ChangeTrackingDictionary(), - signalType, - serializedAdditionalRawData, - metricThresholds, - productionData ?? new ChangeTrackingList(), - samplingRate, - workspaceConnectionId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support writing '{options.Format}' format."); - } - } - - GenerationSafetyQualityMonitoringSignal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationSafetyQualityMonitoringSignal(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMonitoringSignal)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs deleted file mode 100644 index 5b4d82ae80a19..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMonitoringSignal.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation safety quality monitoring signal definition. - public partial class GenerationSafetyQualityMonitoringSignal : MonitoringSignalBase - { - /// Initializes a new instance of . - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - /// is null. - public GenerationSafetyQualityMonitoringSignal(IEnumerable metricThresholds, double samplingRate) - { - Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); - - MetricThresholds = metricThresholds.ToList(); - ProductionData = new ChangeTrackingList(); - SamplingRate = samplingRate; - SignalType = MonitoringSignalType.GenerationSafetyQuality; - } - - /// Initializes a new instance of . - /// The current notification mode for this signal. - /// Property dictionary. Properties can be added, but not removed or altered. - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// - /// Gets or sets the target data for computing metrics. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - /// Gets or sets the workspace connection ID used to connect to the content generation endpoint. - internal GenerationSafetyQualityMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IList metricThresholds, IList productionData, double samplingRate, string workspaceConnectionId) : base(mode, properties, signalType, serializedAdditionalRawData) - { - MetricThresholds = metricThresholds; - ProductionData = productionData; - SamplingRate = samplingRate; - WorkspaceConnectionId = workspaceConnectionId; - SignalType = signalType; - } - - /// Initializes a new instance of for deserialization. - internal GenerationSafetyQualityMonitoringSignal() - { - } - - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - public IList MetricThresholds { get; } - /// - /// Gets or sets the target data for computing metrics. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public IList ProductionData { get; set; } - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - public double SamplingRate { get; set; } - /// Gets or sets the workspace connection ID used to connect to the content generation endpoint. - public string WorkspaceConnectionId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs deleted file mode 100644 index 37ec80c7df375..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetric.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation token statistics metric enum. - public readonly partial struct GenerationTokenStatisticsMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GenerationTokenStatisticsMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TotalTokenCountValue = "TotalTokenCount"; - private const string TotalTokenCountPerGroupValue = "TotalTokenCountPerGroup"; - - /// TotalTokenCount. - public static GenerationTokenStatisticsMetric TotalTokenCount { get; } = new GenerationTokenStatisticsMetric(TotalTokenCountValue); - /// TotalTokenCountPerGroup. - public static GenerationTokenStatisticsMetric TotalTokenCountPerGroup { get; } = new GenerationTokenStatisticsMetric(TotalTokenCountPerGroupValue); - /// Determines if two values are the same. - public static bool operator ==(GenerationTokenStatisticsMetric left, GenerationTokenStatisticsMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GenerationTokenStatisticsMetric left, GenerationTokenStatisticsMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GenerationTokenStatisticsMetric(string value) => new GenerationTokenStatisticsMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GenerationTokenStatisticsMetric other && Equals(other); - /// - public bool Equals(GenerationTokenStatisticsMetric other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs deleted file mode 100644 index 1a0905704cfea..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class GenerationTokenStatisticsMetricThreshold : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GenerationTokenStatisticsMetricThreshold IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationTokenStatisticsMetricThreshold(document.RootElement, options); - } - - internal static GenerationTokenStatisticsMetricThreshold DeserializeGenerationTokenStatisticsMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - GenerationTokenStatisticsMetric metric = default; - MonitoringThreshold threshold = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metric"u8)) - { - metric = new GenerationTokenStatisticsMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - threshold = null; - continue; - } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GenerationTokenStatisticsMetricThreshold(metric, threshold, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support writing '{options.Format}' format."); - } - } - - GenerationTokenStatisticsMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationTokenStatisticsMetricThreshold(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsMetricThreshold)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs deleted file mode 100644 index 47f20f0b16ce3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsMetricThreshold.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation token statistics metric threshold definition. - public partial class GenerationTokenStatisticsMetricThreshold - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationTokenStatisticsMetricThreshold(GenerationTokenStatisticsMetric metric) - { - Metric = metric; - } - - /// Initializes a new instance of . - /// [Required] Gets or sets the feature attribution metric to calculate. - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - /// Keeps track of any properties unknown to the library. - internal GenerationTokenStatisticsMetricThreshold(GenerationTokenStatisticsMetric metric, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) - { - Metric = metric; - Threshold = threshold; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GenerationTokenStatisticsMetricThreshold() - { - } - - /// [Required] Gets or sets the feature attribution metric to calculate. - public GenerationTokenStatisticsMetric Metric { get; set; } - /// - /// Gets or sets the threshold value. - /// If null, a default value will be set depending on the selected metric. - /// - internal MonitoringThreshold Threshold { get; set; } - /// The threshold value. If null, the set default is dependent on the metric type. - public double? ThresholdValue - { - get => Threshold is null ? default : Threshold.Value; - set - { - if (Threshold is null) - Threshold = new MonitoringThreshold(); - Threshold.Value = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs deleted file mode 100644 index 08d92c3ff00f5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.Serialization.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class GenerationTokenStatisticsSignal : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metricThresholds"u8); - writer.WriteStartArray(); - foreach (var item in MetricThresholds) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(ProductionData)) - { - if (ProductionData != null) - { - writer.WritePropertyName("productionData"u8); - writer.WriteObjectValue(ProductionData, options); - } - else - { - writer.WriteNull("productionData"); - } - } - writer.WritePropertyName("samplingRate"u8); - writer.WriteNumberValue(SamplingRate); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - writer.WritePropertyName("signalType"u8); - writer.WriteStringValue(SignalType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GenerationTokenStatisticsSignal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationTokenStatisticsSignal(document.RootElement, options); - } - - internal static GenerationTokenStatisticsSignal DeserializeGenerationTokenStatisticsSignal(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList metricThresholds = default; - MonitoringInputDataBase productionData = default; - double samplingRate = default; - MonitoringNotificationMode? mode = default; - IDictionary properties = default; - MonitoringSignalType signalType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricThresholds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GenerationTokenStatisticsMetricThreshold.DeserializeGenerationTokenStatisticsMetricThreshold(item, options)); - } - metricThresholds = array; - continue; - } - if (property.NameEquals("productionData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - productionData = null; - continue; - } - productionData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); - continue; - } - if (property.NameEquals("samplingRate"u8)) - { - samplingRate = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new MonitoringNotificationMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("signalType"u8)) - { - signalType = new MonitoringSignalType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GenerationTokenStatisticsSignal( - mode, - properties ?? new ChangeTrackingDictionary(), - signalType, - serializedAdditionalRawData, - metricThresholds, - productionData, - samplingRate); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support writing '{options.Format}' format."); - } - } - - GenerationTokenStatisticsSignal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationTokenStatisticsSignal(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GenerationTokenStatisticsSignal)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs deleted file mode 100644 index 1f379fb0c217d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationTokenStatisticsSignal.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Generation token statistics signal definition. - public partial class GenerationTokenStatisticsSignal : MonitoringSignalBase - { - /// Initializes a new instance of . - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - /// is null. - public GenerationTokenStatisticsSignal(IEnumerable metricThresholds, double samplingRate) - { - Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); - - MetricThresholds = metricThresholds.ToList(); - SamplingRate = samplingRate; - SignalType = MonitoringSignalType.GenerationTokenStatistics; - } - - /// Initializes a new instance of . - /// The current notification mode for this signal. - /// Property dictionary. Properties can be added, but not removed or altered. - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - /// - /// Gets or sets the target data for computing metrics. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - internal GenerationTokenStatisticsSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IList metricThresholds, MonitoringInputDataBase productionData, double samplingRate) : base(mode, properties, signalType, serializedAdditionalRawData) - { - MetricThresholds = metricThresholds; - ProductionData = productionData; - SamplingRate = samplingRate; - SignalType = signalType; - } - - /// Initializes a new instance of for deserialization. - internal GenerationTokenStatisticsSignal() - { - } - - /// [Required] Gets or sets the metrics to calculate and the corresponding thresholds. - public IList MetricThresholds { get; } - /// - /// Gets or sets the target data for computing metrics. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public MonitoringInputDataBase ProductionData { get; set; } - /// [Required] The sample rate of the target data, should be greater than 0 and at most 1. - public double SamplingRate { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs new file mode 100644 index 0000000000000..3d9887f1f8464 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class GetBlobReferenceForConsumptionDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BlobUri)) + { + if (BlobUri != null) + { + writer.WritePropertyName("blobUri"u8); + writer.WriteStringValue(BlobUri.AbsoluteUri); + } + else + { + writer.WriteNull("blobUri"); + } + } + if (Optional.IsDefined(Credential)) + { + if (Credential != null) + { + writer.WritePropertyName("credential"u8); + writer.WriteObjectValue(Credential, options); + } + else + { + writer.WriteNull("credential"); + } + } + if (Optional.IsDefined(StorageAccountArmId)) + { + if (StorageAccountArmId != null) + { + writer.WritePropertyName("storageAccountArmId"u8); + writer.WriteStringValue(StorageAccountArmId); + } + else + { + writer.WriteNull("storageAccountArmId"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetBlobReferenceForConsumptionDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetBlobReferenceForConsumptionDto(document.RootElement, options); + } + + internal static GetBlobReferenceForConsumptionDto DeserializeGetBlobReferenceForConsumptionDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri blobUri = default; + DataReferenceCredential credential = default; + string storageAccountArmId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("blobUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + blobUri = null; + continue; + } + blobUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("credential"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + credential = null; + continue; + } + credential = DataReferenceCredential.DeserializeDataReferenceCredential(property.Value, options); + continue; + } + if (property.NameEquals("storageAccountArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + storageAccountArmId = null; + continue; + } + storageAccountArmId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetBlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support writing '{options.Format}' format."); + } + } + + GetBlobReferenceForConsumptionDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetBlobReferenceForConsumptionDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetBlobReferenceForConsumptionDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs new file mode 100644 index 0000000000000..8ccc893decb10 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The GetBlobReferenceForConsumptionDto. + public partial class GetBlobReferenceForConsumptionDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GetBlobReferenceForConsumptionDto() + { + } + + /// Initializes a new instance of . + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// The ARM id of the storage account. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceForConsumptionDto(Uri blobUri, DataReferenceCredential credential, string storageAccountArmId, IDictionary serializedAdditionalRawData) + { + BlobUri = blobUri; + Credential = credential; + StorageAccountArmId = storageAccountArmId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + public Uri BlobUri { get; } + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public DataReferenceCredential Credential { get; } + /// The ARM id of the storage account. + public string StorageAccountArmId { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.Serialization.cs index 53e18169a1f49..e0cfa7d426680 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLBatchInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.Serialization.cs @@ -13,33 +13,43 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class AzureMLBatchInferencingServer : IUtf8JsonSerializable, IJsonModel + public partial class GetBlobReferenceSasRequestDto : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(CodeConfiguration)) + if (Optional.IsDefined(AssetId)) { - if (CodeConfiguration != null) + if (AssetId != null) { - writer.WritePropertyName("codeConfiguration"u8); - writer.WriteObjectValue(CodeConfiguration, options); + writer.WritePropertyName("assetId"u8); + writer.WriteStringValue(AssetId); } else { - writer.WriteNull("codeConfiguration"); + writer.WriteNull("assetId"); + } + } + if (Optional.IsDefined(BlobUri)) + { + if (BlobUri != null) + { + writer.WritePropertyName("blobUri"u8); + writer.WriteStringValue(BlobUri.AbsoluteUri); + } + else + { + writer.WriteNull("blobUri"); } } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - AzureMLBatchInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + GetBlobReferenceSasRequestDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureMLBatchInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasRequestDto(document.RootElement, options); } - internal static AzureMLBatchInferencingServer DeserializeAzureMLBatchInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static GetBlobReferenceSasRequestDto DeserializeGetBlobReferenceSasRequestDto(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +88,30 @@ internal static AzureMLBatchInferencingServer DeserializeAzureMLBatchInferencing { return null; } - MachineLearningCodeConfiguration codeConfiguration = default; - InferencingServerType serverType = default; + string assetId = default; + Uri blobUri = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("codeConfiguration"u8)) + if (property.NameEquals("assetId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - codeConfiguration = null; + assetId = null; continue; } - codeConfiguration = MachineLearningCodeConfiguration.DeserializeMachineLearningCodeConfiguration(property.Value, options); + assetId = property.Value.GetString(); continue; } - if (property.NameEquals("serverType"u8)) + if (property.NameEquals("blobUri"u8)) { - serverType = new InferencingServerType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + blobUri = null; + continue; + } + blobUri = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,38 +120,38 @@ internal static AzureMLBatchInferencingServer DeserializeAzureMLBatchInferencing } } serializedAdditionalRawData = rawDataDictionary; - return new AzureMLBatchInferencingServer(serverType, serializedAdditionalRawData, codeConfiguration); + return new GetBlobReferenceSasRequestDto(assetId, blobUri, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support writing '{options.Format}' format."); } } - AzureMLBatchInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + GetBlobReferenceSasRequestDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureMLBatchInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasRequestDto(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureMLBatchInferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasRequestDto)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs new file mode 100644 index 0000000000000..c860522e59fa8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// BlobReferenceSASRequest for getBlobReferenceSAS API. + public partial class GetBlobReferenceSasRequestDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GetBlobReferenceSasRequestDto() + { + } + + /// Initializes a new instance of . + /// Id of the asset to be accessed. + /// Blob uri of the asset to be accessed. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceSasRequestDto(string assetId, Uri blobUri, IDictionary serializedAdditionalRawData) + { + AssetId = assetId; + BlobUri = blobUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Id of the asset to be accessed. + public string AssetId { get; set; } + /// Blob uri of the asset to be accessed. + public Uri BlobUri { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.Serialization.cs index 8dbb9f086d9f6..3ee870a9c3a78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureMLOnlineInferencingServer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.Serialization.cs @@ -13,33 +13,31 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class AzureMLOnlineInferencingServer : IUtf8JsonSerializable, IJsonModel + public partial class GetBlobReferenceSasResponseDto : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(CodeConfiguration)) + if (Optional.IsDefined(BlobReferenceForConsumption)) { - if (CodeConfiguration != null) + if (BlobReferenceForConsumption != null) { - writer.WritePropertyName("codeConfiguration"u8); - writer.WriteObjectValue(CodeConfiguration, options); + writer.WritePropertyName("blobReferenceForConsumption"u8); + writer.WriteObjectValue(BlobReferenceForConsumption, options); } else { - writer.WriteNull("codeConfiguration"); + writer.WriteNull("blobReferenceForConsumption"); } } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - AzureMLOnlineInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + GetBlobReferenceSasResponseDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureMLOnlineInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasResponseDto(document.RootElement, options); } - internal static AzureMLOnlineInferencingServer DeserializeAzureMLOnlineInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) + internal static GetBlobReferenceSasResponseDto DeserializeGetBlobReferenceSasResponseDto(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +76,19 @@ internal static AzureMLOnlineInferencingServer DeserializeAzureMLOnlineInferenci { return null; } - MachineLearningCodeConfiguration codeConfiguration = default; - InferencingServerType serverType = default; + GetBlobReferenceForConsumptionDto blobReferenceForConsumption = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("codeConfiguration"u8)) + if (property.NameEquals("blobReferenceForConsumption"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - codeConfiguration = null; + blobReferenceForConsumption = null; continue; } - codeConfiguration = MachineLearningCodeConfiguration.DeserializeMachineLearningCodeConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("serverType"u8)) - { - serverType = new InferencingServerType(property.Value.GetString()); + blobReferenceForConsumption = GetBlobReferenceForConsumptionDto.DeserializeGetBlobReferenceForConsumptionDto(property.Value, options); continue; } if (options.Format != "W") @@ -105,38 +97,38 @@ internal static AzureMLOnlineInferencingServer DeserializeAzureMLOnlineInferenci } } serializedAdditionalRawData = rawDataDictionary; - return new AzureMLOnlineInferencingServer(serverType, serializedAdditionalRawData, codeConfiguration); + return new GetBlobReferenceSasResponseDto(blobReferenceForConsumption, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support writing '{options.Format}' format."); } } - AzureMLOnlineInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + GetBlobReferenceSasResponseDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureMLOnlineInferencingServer(document.RootElement, options); + return DeserializeGetBlobReferenceSasResponseDto(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureMLOnlineInferencingServer)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(GetBlobReferenceSasResponseDto)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs new file mode 100644 index 0000000000000..b5f0725cb8d29 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasResponseDto.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// BlobReferenceSASResponse for getBlobReferenceSAS API. + public partial class GetBlobReferenceSasResponseDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GetBlobReferenceSasResponseDto() + { + } + + /// Initializes a new instance of . + /// Blob reference for consumption details. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceSasResponseDto(GetBlobReferenceForConsumptionDto blobReferenceForConsumption, IDictionary serializedAdditionalRawData) + { + BlobReferenceForConsumption = blobReferenceForConsumption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Blob reference for consumption details. + public GetBlobReferenceForConsumptionDto BlobReferenceForConsumption { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs deleted file mode 100644 index ec5494c0cf0e1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.Serialization.cs +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class HdfsDatastore : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(HdfsServerCertificate)) - { - if (HdfsServerCertificate != null) - { - writer.WritePropertyName("hdfsServerCertificate"u8); - writer.WriteStringValue(HdfsServerCertificate); - } - else - { - writer.WriteNull("hdfsServerCertificate"); - } - } - writer.WritePropertyName("nameNodeAddress"u8); - writer.WriteStringValue(NameNodeAddress); - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol); - } - writer.WritePropertyName("credentials"u8); - writer.WriteObjectValue(Credentials, options); - writer.WritePropertyName("datastoreType"u8); - writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (options.Format != "W" && Optional.IsDefined(IsDefault)) - { - writer.WritePropertyName("isDefault"u8); - writer.WriteBooleanValue(IsDefault.Value); - } - if (Optional.IsDefined(Description)) - { - if (Description != null) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - else - { - writer.WriteNull("description"); - } - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - HdfsDatastore IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHdfsDatastore(document.RootElement, options); - } - - internal static HdfsDatastore DeserializeHdfsDatastore(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string hdfsServerCertificate = default; - string nameNodeAddress = default; - string protocol = default; - MachineLearningDatastoreCredentials credentials = default; - DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; - bool? isDefault = default; - string description = default; - IDictionary properties = default; - IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("hdfsServerCertificate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - hdfsServerCertificate = null; - continue; - } - hdfsServerCertificate = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameNodeAddress"u8)) - { - nameNodeAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("protocol"u8)) - { - protocol = property.Value.GetString(); - continue; - } - if (property.NameEquals("credentials"u8)) - { - credentials = MachineLearningDatastoreCredentials.DeserializeMachineLearningDatastoreCredentials(property.Value, options); - continue; - } - if (property.NameEquals("datastoreType"u8)) - { - datastoreType = new DatastoreType(property.Value.GetString()); - continue; - } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("isDefault"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isDefault = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("description"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - description = null; - continue; - } - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new HdfsDatastore( - description, - properties ?? new ChangeTrackingDictionary(), - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - credentials, - datastoreType, - intellectualProperty, - isDefault, - hdfsServerCertificate, - nameNodeAddress, - protocol); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support writing '{options.Format}' format."); - } - } - - HdfsDatastore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeHdfsDatastore(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(HdfsDatastore)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs deleted file mode 100644 index e999a88598d99..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/HdfsDatastore.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The HdfsDatastore. - public partial class HdfsDatastore : MachineLearningDatastoreProperties - { - /// Initializes a new instance of . - /// - /// [Required] Account credentials. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . - /// - /// [Required] IP Address or DNS HostName. - /// or is null. - public HdfsDatastore(MachineLearningDatastoreCredentials credentials, string nameNodeAddress) : base(credentials) - { - Argument.AssertNotNull(credentials, nameof(credentials)); - Argument.AssertNotNull(nameNodeAddress, nameof(nameNodeAddress)); - - NameNodeAddress = nameNodeAddress; - DatastoreType = DatastoreType.Hdfs; - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Keeps track of any properties unknown to the library. - /// - /// [Required] Account credentials. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . - /// - /// [Required] Storage type backing the datastore. - /// Intellectual Property details. - /// Readonly property to indicate if datastore is the workspace default datastore. - /// The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. - /// [Required] IP Address or DNS HostName. - /// Protocol used to communicate with the storage account (Https/Http). - internal HdfsDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string hdfsServerCertificate, string nameNodeAddress, string protocol) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) - { - HdfsServerCertificate = hdfsServerCertificate; - NameNodeAddress = nameNodeAddress; - Protocol = protocol; - DatastoreType = datastoreType; - } - - /// Initializes a new instance of for deserialization. - internal HdfsDatastore() - { - } - - /// The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. - public string HdfsServerCertificate { get; set; } - /// [Required] IP Address or DNS HostName. - public string NameNodeAddress { get; set; } - /// Protocol used to communicate with the storage account (Https/Http). - public string Protocol { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs deleted file mode 100644 index 1ebf527ae9aa3..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageAnnotationType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Annotation type of image data. - public readonly partial struct ImageAnnotationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ImageAnnotationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ClassificationValue = "Classification"; - private const string BoundingBoxValue = "BoundingBox"; - private const string InstanceSegmentationValue = "InstanceSegmentation"; - - /// Classification. - public static ImageAnnotationType Classification { get; } = new ImageAnnotationType(ClassificationValue); - /// BoundingBox. - public static ImageAnnotationType BoundingBox { get; } = new ImageAnnotationType(BoundingBoxValue); - /// InstanceSegmentation. - public static ImageAnnotationType InstanceSegmentation { get; } = new ImageAnnotationType(InstanceSegmentationValue); - /// Determines if two values are the same. - public static bool operator ==(ImageAnnotationType left, ImageAnnotationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ImageAnnotationType left, ImageAnnotationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ImageAnnotationType(string value) => new ImageAnnotationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ImageAnnotationType other && Equals(other); - /// - public bool Equals(ImageAnnotationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs index b92f504003c2a..be73136069480 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs @@ -41,6 +41,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WritePropertyName("isLatestOsImageVersion"u8); writer.WriteBooleanValue(IsLatestOSImageVersion.Value); } + if (options.Format != "W" && Optional.IsDefined(OSPatchingStatus)) + { + writer.WritePropertyName("osPatchingStatus"u8); + writer.WriteObjectValue(OSPatchingStatus, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,6 +87,7 @@ internal static ImageMetadata DeserializeImageMetadata(JsonElement element, Mode string currentImageVersion = default; string latestImageVersion = default; bool? isLatestOSImageVersion = default; + OSPatchingStatus osPatchingStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,13 +111,22 @@ internal static ImageMetadata DeserializeImageMetadata(JsonElement element, Mode isLatestOSImageVersion = property.Value.GetBoolean(); continue; } + if (property.NameEquals("osPatchingStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osPatchingStatus = OSPatchingStatus.DeserializeOSPatchingStatus(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, serializedAdditionalRawData); + return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, osPatchingStatus, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs index 8ce59c4080654..b469c7188effa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs @@ -54,12 +54,14 @@ internal ImageMetadata() /// Specifies the current operating system image version this compute instance is running on. /// Specifies the latest available operating system image version. /// Specifies whether this compute instance is running on the latest operating system image. + /// Metadata about the os patching. /// Keeps track of any properties unknown to the library. - internal ImageMetadata(string currentImageVersion, string latestImageVersion, bool? isLatestOSImageVersion, IDictionary serializedAdditionalRawData) + internal ImageMetadata(string currentImageVersion, string latestImageVersion, bool? isLatestOSImageVersion, OSPatchingStatus osPatchingStatus, IDictionary serializedAdditionalRawData) { CurrentImageVersion = currentImageVersion; LatestImageVersion = latestImageVersion; IsLatestOSImageVersion = isLatestOSImageVersion; + OSPatchingStatus = osPatchingStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -69,5 +71,7 @@ internal ImageMetadata(string currentImageVersion, string latestImageVersion, bo public string LatestImageVersion { get; } /// Specifies whether this compute instance is running on the latest operating system image. public bool? IsLatestOSImageVersion { get; } + /// Metadata about the os patching. + public OSPatchingStatus OSPatchingStatus { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs index 12a14798d215e..cf9df54411cbf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.Serialization.cs @@ -62,16 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("imageSize"); } } - if (Optional.IsDefined(LogTrainingMetrics)) - { - writer.WritePropertyName("logTrainingMetrics"u8); - writer.WriteStringValue(LogTrainingMetrics.Value.ToString()); - } - if (Optional.IsDefined(LogValidationLoss)) - { - writer.WritePropertyName("logValidationLoss"u8); - writer.WriteStringValue(LogValidationLoss.Value.ToString()); - } if (Optional.IsDefined(MaxSize)) { if (MaxSize != null) @@ -589,8 +579,6 @@ internal static ImageModelSettingsObjectDetection DeserializeImageModelSettingsO int? boxDetectionsPerImage = default; float? boxScoreThreshold = default; int? imageSize = default; - LogTrainingMetric? logTrainingMetrics = default; - LogValidationLoss? logValidationLoss = default; int? maxSize = default; int? minSize = default; MachineLearningModelSize? modelSize = default; @@ -667,24 +655,6 @@ internal static ImageModelSettingsObjectDetection DeserializeImageModelSettingsO imageSize = property.Value.GetInt32(); continue; } - if (property.NameEquals("logTrainingMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - logTrainingMetrics = new LogTrainingMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("logValidationLoss"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - logValidationLoss = new LogValidationLoss(property.Value.GetString()); - continue; - } if (property.NameEquals("maxSize"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -1144,8 +1114,6 @@ internal static ImageModelSettingsObjectDetection DeserializeImageModelSettingsO boxDetectionsPerImage, boxScoreThreshold, imageSize, - logTrainingMetrics, - logValidationLoss, maxSize, minSize, modelSize, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs index 28369c404f2db..8c7361f6720ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs @@ -88,8 +88,6 @@ public ImageModelSettingsObjectDetection() /// Note: The training run may get into CUDA OOM if the size is too big. /// Note: This settings is only supported for the 'yolov5' algorithm. /// - /// Enable computing and logging training metrics. - /// Enable computing and logging validation loss. /// /// Maximum size of the image to be rescaled before feeding it to the backbone. /// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. @@ -127,13 +125,11 @@ public ImageModelSettingsObjectDetection() /// /// IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. /// Metric computation method to use for validation metrics. - internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGradient, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, MachineLearningFlowModelJobInput checkpointModel, string checkpointRunId, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, bool? enableOnnxNormalization, int? evaluationFrequency, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, IDictionary serializedAdditionalRawData, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, LogTrainingMetric? logTrainingMetrics, LogValidationLoss? logValidationLoss, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointFrequency, checkpointModel, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay, serializedAdditionalRawData) + internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGradient, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, MachineLearningFlowModelJobInput checkpointModel, string checkpointRunId, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, bool? enableOnnxNormalization, int? evaluationFrequency, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, IDictionary serializedAdditionalRawData, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointFrequency, checkpointModel, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay, serializedAdditionalRawData) { BoxDetectionsPerImage = boxDetectionsPerImage; BoxScoreThreshold = boxScoreThreshold; ImageSize = imageSize; - LogTrainingMetrics = logTrainingMetrics; - LogValidationLoss = logValidationLoss; MaxSize = maxSize; MinSize = minSize; ModelSize = modelSize; @@ -162,10 +158,6 @@ internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGra /// Note: This settings is only supported for the 'yolov5' algorithm. /// public int? ImageSize { get; set; } - /// Enable computing and logging training metrics. - public LogTrainingMetric? LogTrainingMetrics { get; set; } - /// Enable computing and logging validation loss. - public LogValidationLoss? LogValidationLoss { get; set; } /// /// Maximum size of the image to be rescaled before feeding it to the backbone. /// Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs index 8b0b6b9dfe696..b3d8dbe0babe5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs @@ -36,6 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti writer.WritePropertyName("reference"u8); writer.WriteStringValue(Reference); } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -73,6 +78,7 @@ internal static ImageSetting DeserializeImageSetting(JsonElement element, ModelR } ImageType? type = default; string reference = default; + string version = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,10 +97,15 @@ internal static ImageSetting DeserializeImageSetting(JsonElement element, ModelR reference = property.Value.GetString(); continue; } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new ImageSetting(type, reference, additionalProperties); + return new ImageSetting(type, reference, version, additionalProperties); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs index 00ef5ac2fa0ba..8a86ab8a2086f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs @@ -20,20 +20,24 @@ public ImageSetting() } /// Initializes a new instance of . - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. - /// Image reference URL. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). + /// Image reference URL if type is docker. Environment name if type is azureml. + /// Version of image being used. If latest then skip this field. /// Additional Properties. - internal ImageSetting(ImageType? imageType, string reference, IDictionary additionalProperties) + internal ImageSetting(ImageType? imageType, string reference, string version, IDictionary additionalProperties) { ImageType = imageType; Reference = reference; + Version = version; AdditionalProperties = additionalProperties; } - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). public ImageType? ImageType { get; set; } - /// Image reference URL. + /// Image reference URL if type is docker. Environment name if type is azureml. public string Reference { get; set; } + /// Version of image being used. If latest then skip this field. + public string Version { get; set; } /// /// Additional Properties /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs index 921a3729b3b09..55108f7d762d6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). public readonly partial struct ImageType : IEquatable { private readonly string _value; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs deleted file mode 100644 index c1dd1a54b14da..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ImportDataAction : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ImportDataAction)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("dataImportDefinition"u8); - writer.WriteObjectValue(DataImportDefinition, options); - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ImportDataAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ImportDataAction)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeImportDataAction(document.RootElement, options); - } - - internal static ImportDataAction DeserializeImportDataAction(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataImport dataImportDefinition = default; - ScheduleActionType actionType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("dataImportDefinition"u8)) - { - dataImportDefinition = DataImport.DeserializeDataImport(property.Value, options); - continue; - } - if (property.NameEquals("actionType"u8)) - { - actionType = new ScheduleActionType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ImportDataAction(actionType, serializedAdditionalRawData, dataImportDefinition); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ImportDataAction)} does not support writing '{options.Format}' format."); - } - } - - ImportDataAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeImportDataAction(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ImportDataAction)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs deleted file mode 100644 index e2c041d7741bc..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImportDataAction.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The ImportDataAction. - public partial class ImportDataAction : MachineLearningScheduleAction - { - /// Initializes a new instance of . - /// [Required] Defines Schedule action definition details. - /// is null. - public ImportDataAction(DataImport dataImportDefinition) - { - Argument.AssertNotNull(dataImportDefinition, nameof(dataImportDefinition)); - - DataImportDefinition = dataImportDefinition; - ActionType = ScheduleActionType.ImportData; - } - - /// Initializes a new instance of . - /// [Required] Specifies the action type of the schedule. - /// Keeps track of any properties unknown to the library. - /// [Required] Defines Schedule action definition details. - internal ImportDataAction(ScheduleActionType actionType, IDictionary serializedAdditionalRawData, DataImport dataImportDefinition) : base(actionType, serializedAdditionalRawData) - { - DataImportDefinition = dataImportDefinition; - ActionType = actionType; - } - - /// Initializes a new instance of for deserialization. - internal ImportDataAction() - { - } - - /// [Required] Defines Schedule action definition details. - public DataImport DataImportDefinition { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs deleted file mode 100644 index 600516bf43093..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IncrementalDataRefresh.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Whether IncrementalDataRefresh is enabled. - public readonly partial struct IncrementalDataRefresh : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IncrementalDataRefresh(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static IncrementalDataRefresh Enabled { get; } = new IncrementalDataRefresh(EnabledValue); - /// Disabled. - public static IncrementalDataRefresh Disabled { get; } = new IncrementalDataRefresh(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(IncrementalDataRefresh left, IncrementalDataRefresh right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IncrementalDataRefresh left, IncrementalDataRefresh right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IncrementalDataRefresh(string value) => new IncrementalDataRefresh(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IncrementalDataRefresh other && Equals(other); - /// - public bool Equals(IncrementalDataRefresh other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs index e50bb72ffd355..6943530eba792 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IndexColumn.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing index column. + /// DTO object representing index column. public partial class IndexColumn { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs deleted file mode 100644 index 45bde9204ed58..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.Serialization.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownInferencingServer))] - public partial class InferencingServer : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInferencingServer(document.RootElement, options); - } - - internal static InferencingServer DeserializeInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("serverType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureMLBatch": return AzureMLBatchInferencingServer.DeserializeAzureMLBatchInferencingServer(element, options); - case "AzureMLOnline": return AzureMLOnlineInferencingServer.DeserializeAzureMLOnlineInferencingServer(element, options); - case "Custom": return CustomInferencingServer.DeserializeCustomInferencingServer(element, options); - case "Triton": return TritonInferencingServer.DeserializeTritonInferencingServer(element, options); - } - } - return UnknownInferencingServer.DeserializeUnknownInferencingServer(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support writing '{options.Format}' format."); - } - } - - InferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInferencingServer(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InferencingServer)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs deleted file mode 100644 index 4618bed24d110..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServer.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public abstract partial class InferencingServer - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected InferencingServer() - { - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - internal InferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData) - { - ServerType = serverType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Inferencing server type for various targets. - internal InferencingServerType ServerType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs deleted file mode 100644 index 17bd6dafc12af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InferencingServerType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Inferencing server type for various targets. - internal readonly partial struct InferencingServerType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InferencingServerType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureMLOnlineValue = "AzureMLOnline"; - private const string AzureMLBatchValue = "AzureMLBatch"; - private const string TritonValue = "Triton"; - private const string CustomValue = "Custom"; - - /// AzureMLOnline. - public static InferencingServerType AzureMLOnline { get; } = new InferencingServerType(AzureMLOnlineValue); - /// AzureMLBatch. - public static InferencingServerType AzureMLBatch { get; } = new InferencingServerType(AzureMLBatchValue); - /// Triton. - public static InferencingServerType Triton { get; } = new InferencingServerType(TritonValue); - /// Custom. - public static InferencingServerType Custom { get; } = new InferencingServerType(CustomValue); - /// Determines if two values are the same. - public static bool operator ==(InferencingServerType left, InferencingServerType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InferencingServerType left, InferencingServerType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InferencingServerType(string value) => new InferencingServerType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InferencingServerType other && Equals(other); - /// - public bool Equals(InferencingServerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs deleted file mode 100644 index 7ad2cbbb9b24c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/InputPathType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Input path type for package inputs. - internal readonly partial struct InputPathType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InputPathType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UrlValue = "Url"; - private const string PathIdValue = "PathId"; - private const string PathVersionValue = "PathVersion"; - - /// Url. - public static InputPathType Url { get; } = new InputPathType(UrlValue); - /// PathId. - public static InputPathType PathId { get; } = new InputPathType(PathIdValue); - /// PathVersion. - public static InputPathType PathVersion { get; } = new InputPathType(PathVersionValue); - /// Determines if two values are the same. - public static bool operator ==(InputPathType left, InputPathType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InputPathType left, InputPathType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InputPathType(string value) => new InputPathType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InputPathType other && Equals(other); - /// - public bool Equals(InputPathType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs deleted file mode 100644 index 4119c0a17ed6e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProtectionLevel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Protection level associated with the Intellectual Property. - public readonly partial struct IntellectualProtectionLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IntellectualProtectionLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AllValue = "All"; - private const string NoneValue = "None"; - - /// All means Intellectual Property is fully protected. - public static IntellectualProtectionLevel All { get; } = new IntellectualProtectionLevel(AllValue); - /// None means it is not an Intellectual Property. - public static IntellectualProtectionLevel None { get; } = new IntellectualProtectionLevel(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(IntellectualProtectionLevel left, IntellectualProtectionLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IntellectualProtectionLevel left, IntellectualProtectionLevel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IntellectualProtectionLevel(string value) => new IntellectualProtectionLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IntellectualProtectionLevel other && Equals(other); - /// - public bool Equals(IntellectualProtectionLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs deleted file mode 100644 index 79f3cbb6290d5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobProvisioningState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum to determine the job provisioning state. - public readonly partial struct JobProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string InProgressValue = "InProgress"; - - /// Succeeded. - public static JobProvisioningState Succeeded { get; } = new JobProvisioningState(SucceededValue); - /// Failed. - public static JobProvisioningState Failed { get; } = new JobProvisioningState(FailedValue); - /// Canceled. - public static JobProvisioningState Canceled { get; } = new JobProvisioningState(CanceledValue); - /// InProgress. - public static JobProvisioningState InProgress { get; } = new JobProvisioningState(InProgressValue); - /// Determines if two values are the same. - public static bool operator ==(JobProvisioningState left, JobProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobProvisioningState left, JobProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JobProvisioningState(string value) => new JobProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobProvisioningState other && Equals(other); - /// - public bool Equals(JobProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs index a64e8cb7236f2..346cceeb85de9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class JobQueueSettings : IUtf8JsonSerializable, IJsonModel + internal partial class JobQueueSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -31,18 +31,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("jobTier"u8); writer.WriteStringValue(JobTier.Value.ToString()); } - if (Optional.IsDefined(Priority)) - { - if (Priority != null) - { - writer.WritePropertyName("priority"u8); - writer.WriteNumberValue(Priority.Value); - } - else - { - writer.WriteNull("priority"); - } - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,7 +70,6 @@ internal static JobQueueSettings DeserializeJobQueueSettings(JsonElement element return null; } JobTier? jobTier = default; - int? priority = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,23 +83,13 @@ internal static JobQueueSettings DeserializeJobQueueSettings(JsonElement element jobTier = new JobTier(property.Value.GetString()); continue; } - if (property.NameEquals("priority"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - priority = null; - continue; - } - priority = property.Value.GetInt32(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new JobQueueSettings(jobTier, priority, serializedAdditionalRawData); + return new JobQueueSettings(jobTier, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs index 7687041aa01c4..80e6ee11db463 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobQueueSettings.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// The JobQueueSettings. - public partial class JobQueueSettings + internal partial class JobQueueSettings { /// /// Keeps track of any properties unknown to the library. @@ -52,18 +52,14 @@ public JobQueueSettings() /// Initializes a new instance of . /// Controls the compute job tier. - /// Controls the priority of the job on a compute. /// Keeps track of any properties unknown to the library. - internal JobQueueSettings(JobTier? jobTier, int? priority, IDictionary serializedAdditionalRawData) + internal JobQueueSettings(JobTier? jobTier, IDictionary serializedAdditionalRawData) { JobTier = jobTier; - Priority = priority; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Controls the compute job tier. public JobTier? JobTier { get; set; } - /// Controls the priority of the job on a compute. - public int? Priority { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs new file mode 100644 index 0000000000000..de945e485cd9e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class JobResources : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobResources)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(InstanceTypes)) + { + writer.WritePropertyName("instanceTypes"u8); + writer.WriteStartArray(); + foreach (var item in InstanceTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + JobResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobResources)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobResources(document.RootElement, options); + } + + internal static JobResources DeserializeJobResources(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList instanceTypes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + instanceTypes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobResources(instanceTypes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(JobResources)} does not support writing '{options.Format}' format."); + } + } + + JobResources IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobResources(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobResources)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs new file mode 100644 index 0000000000000..679716f254b4f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The JobResources. + internal partial class JobResources + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public JobResources() + { + InstanceTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of instance types to choose from. + /// Keeps track of any properties unknown to the library. + internal JobResources(IList instanceTypes, IDictionary serializedAdditionalRawData) + { + InstanceTypes = instanceTypes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of instance types to choose from. + public IList InstanceTypes { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs deleted file mode 100644 index 54a0f01911a2b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessageLevel.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The JobStatusMessageLevel. - public readonly partial struct JobStatusMessageLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobStatusMessageLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ErrorValue = "Error"; - private const string InformationValue = "Information"; - private const string WarningValue = "Warning"; - - /// Error. - public static JobStatusMessageLevel Error { get; } = new JobStatusMessageLevel(ErrorValue); - /// Information. - public static JobStatusMessageLevel Information { get; } = new JobStatusMessageLevel(InformationValue); - /// Warning. - public static JobStatusMessageLevel Warning { get; } = new JobStatusMessageLevel(WarningValue); - /// Determines if two values are the same. - public static bool operator ==(JobStatusMessageLevel left, JobStatusMessageLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobStatusMessageLevel left, JobStatusMessageLevel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JobStatusMessageLevel(string value) => new JobStatusMessageLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobStatusMessageLevel other && Equals(other); - /// - public bool Equals(JobStatusMessageLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs index 0962389dee3d7..8c54c4277960c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs @@ -24,23 +24,23 @@ public JobType(string value) private const string AutoMLValue = "AutoML"; private const string CommandValue = "Command"; - private const string LabelingValue = "Labeling"; private const string SweepValue = "Sweep"; private const string PipelineValue = "Pipeline"; private const string SparkValue = "Spark"; + private const string FineTuningValue = "FineTuning"; /// AutoML. public static JobType AutoML { get; } = new JobType(AutoMLValue); /// Command. public static JobType Command { get; } = new JobType(CommandValue); - /// Labeling. - public static JobType Labeling { get; } = new JobType(LabelingValue); /// Sweep. public static JobType Sweep { get; } = new JobType(SweepValue); /// Pipeline. public static JobType Pipeline { get; } = new JobType(PipelineValue); /// Spark. public static JobType Spark { get; } = new JobType(SparkValue); + /// FineTuning. + public static JobType FineTuning { get; } = new JobType(FineTuningValue); /// Determines if two values are the same. public static bool operator ==(JobType left, JobType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs index 224f4981ec9bb..d89bab0267277 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs @@ -13,42 +13,38 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class SecretConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class JupyterKernelConfig : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsCollectionDefined(Argv)) { - if (Uri != null) + writer.WritePropertyName("argv"u8); + writer.WriteStartArray(); + foreach (var item in Argv) { - writer.WritePropertyName("uri"u8); - writer.WriteStringValue(Uri.AbsoluteUri); - } - else - { - writer.WriteNull("uri"); + writer.WriteStringValue(item); } + writer.WriteEndArray(); } - if (Optional.IsDefined(WorkspaceSecretName)) + if (Optional.IsDefined(DisplayName)) { - if (WorkspaceSecretName != null) - { - writer.WritePropertyName("workspaceSecretName"u8); - writer.WriteStringValue(WorkspaceSecretName); - } - else - { - writer.WriteNull("workspaceSecretName"); - } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -68,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - SecretConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + JupyterKernelConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSecretConfiguration(document.RootElement, options); + return DeserializeJupyterKernelConfig(document.RootElement, options); } - internal static SecretConfiguration DeserializeSecretConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static JupyterKernelConfig DeserializeJupyterKernelConfig(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,30 +84,35 @@ internal static SecretConfiguration DeserializeSecretConfiguration(JsonElement e { return null; } - Uri uri = default; - string workspaceSecretName = default; + IList argv = default; + string displayName = default; + string language = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("uri"u8)) + if (property.NameEquals("argv"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - uri = null; continue; } - uri = new Uri(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + argv = array; continue; } - if (property.NameEquals("workspaceSecretName"u8)) + if (property.NameEquals("displayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - workspaceSecretName = null; - continue; - } - workspaceSecretName = property.Value.GetString(); + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); continue; } if (options.Format != "W") @@ -120,38 +121,38 @@ internal static SecretConfiguration DeserializeSecretConfiguration(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new SecretConfiguration(uri, workspaceSecretName, serializedAdditionalRawData); + return new JupyterKernelConfig(argv ?? new ChangeTrackingList(), displayName, language, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{options.Format}' format."); } } - SecretConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + JupyterKernelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSecretConfiguration(document.RootElement, options); + return DeserializeJupyterKernelConfig(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SecretConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs index 796c609008be6..5c65ae7b9990d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobStatusMessage.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Active message associated with project. - public partial class JobStatusMessage + /// Jupyter kernel configuration. + public partial class JupyterKernelConfig { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +45,30 @@ public partial class JobStatusMessage /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal JobStatusMessage() + /// Initializes a new instance of . + public JupyterKernelConfig() { + Argv = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Service-defined message code. - /// Time in UTC at which the message was created. - /// Severity level of message. - /// A human-readable representation of the message code. + /// Initializes a new instance of . + /// Argument to the the runtime. + /// Display name of the kernel. + /// Language of the kernel [Example value: python]. /// Keeps track of any properties unknown to the library. - internal JobStatusMessage(string code, DateTimeOffset? createdOn, JobStatusMessageLevel? level, string message, IDictionary serializedAdditionalRawData) + internal JupyterKernelConfig(IList argv, string displayName, string language, IDictionary serializedAdditionalRawData) { - Code = code; - CreatedOn = createdOn; - Level = level; - Message = message; + Argv = argv; + DisplayName = displayName; + Language = language; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Service-defined message code. - public string Code { get; } - /// Time in UTC at which the message was created. - public DateTimeOffset? CreatedOn { get; } - /// Severity level of message. - public JobStatusMessageLevel? Level { get; } - /// A human-readable representation of the message code. - public string Message { get; } + /// Argument to the the runtime. + public IList Argv { get; } + /// Display name of the kernel. + public string DisplayName { get; set; } + /// Language of the kernel [Example value: python]. + public string Language { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs deleted file mode 100644 index a3fcfb7d7467d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.Serialization.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class KerberosKeytabCredentials : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("secrets"u8); - writer.WriteObjectValue(Secrets, options); - writer.WritePropertyName("kerberosKdcAddress"u8); - writer.WriteStringValue(KerberosKdcAddress); - writer.WritePropertyName("kerberosPrincipal"u8); - writer.WriteStringValue(KerberosPrincipal); - writer.WritePropertyName("kerberosRealm"u8); - writer.WriteStringValue(KerberosRealm); - writer.WritePropertyName("credentialsType"u8); - writer.WriteStringValue(CredentialsType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KerberosKeytabCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosKeytabCredentials(document.RootElement, options); - } - - internal static KerberosKeytabCredentials DeserializeKerberosKeytabCredentials(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - KerberosKeytabSecrets secrets = default; - string kerberosKdcAddress = default; - string kerberosPrincipal = default; - string kerberosRealm = default; - CredentialsType credentialsType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("secrets"u8)) - { - secrets = KerberosKeytabSecrets.DeserializeKerberosKeytabSecrets(property.Value, options); - continue; - } - if (property.NameEquals("kerberosKdcAddress"u8)) - { - kerberosKdcAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosPrincipal"u8)) - { - kerberosPrincipal = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosRealm"u8)) - { - kerberosRealm = property.Value.GetString(); - continue; - } - if (property.NameEquals("credentialsType"u8)) - { - credentialsType = new CredentialsType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KerberosKeytabCredentials( - credentialsType, - serializedAdditionalRawData, - secrets, - kerberosKdcAddress, - kerberosPrincipal, - kerberosRealm); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support writing '{options.Format}' format."); - } - } - - KerberosKeytabCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosKeytabCredentials(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KerberosKeytabCredentials)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs deleted file mode 100644 index 78c2cbf8e7572..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabCredentials.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosKeytabCredentials. - public partial class KerberosKeytabCredentials : MachineLearningDatastoreCredentials - { - /// Initializes a new instance of . - /// [Required] Keytab secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - /// , , or is null. - public KerberosKeytabCredentials(KerberosKeytabSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) - { - Argument.AssertNotNull(secrets, nameof(secrets)); - Argument.AssertNotNull(kerberosKdcAddress, nameof(kerberosKdcAddress)); - Argument.AssertNotNull(kerberosPrincipal, nameof(kerberosPrincipal)); - Argument.AssertNotNull(kerberosRealm, nameof(kerberosRealm)); - - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = CredentialsType.KerberosKeytab; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// [Required] Keytab secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - internal KerberosKeytabCredentials(CredentialsType credentialsType, IDictionary serializedAdditionalRawData, KerberosKeytabSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) : base(credentialsType, serializedAdditionalRawData) - { - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = credentialsType; - } - - /// Initializes a new instance of for deserialization. - internal KerberosKeytabCredentials() - { - } - - /// [Required] Keytab secrets. - public KerberosKeytabSecrets Secrets { get; set; } - /// [Required] IP Address or DNS HostName. - public string KerberosKdcAddress { get; set; } - /// [Required] Kerberos Username. - public string KerberosPrincipal { get; set; } - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - public string KerberosRealm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs deleted file mode 100644 index 8724364431935..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosKeytabSecrets.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosKeytabSecrets. - public partial class KerberosKeytabSecrets : MachineLearningDatastoreSecrets - { - /// Initializes a new instance of . - public KerberosKeytabSecrets() - { - SecretsType = SecretsType.KerberosKeytab; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// Kerberos keytab secret. - internal KerberosKeytabSecrets(SecretsType secretsType, IDictionary serializedAdditionalRawData, string kerberosKeytab) : base(secretsType, serializedAdditionalRawData) - { - KerberosKeytab = kerberosKeytab; - SecretsType = secretsType; - } - - /// Kerberos keytab secret. - public string KerberosKeytab { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs deleted file mode 100644 index 4687f18e42ebb..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.Serialization.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class KerberosPasswordCredentials : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("secrets"u8); - writer.WriteObjectValue(Secrets, options); - writer.WritePropertyName("kerberosKdcAddress"u8); - writer.WriteStringValue(KerberosKdcAddress); - writer.WritePropertyName("kerberosPrincipal"u8); - writer.WriteStringValue(KerberosPrincipal); - writer.WritePropertyName("kerberosRealm"u8); - writer.WriteStringValue(KerberosRealm); - writer.WritePropertyName("credentialsType"u8); - writer.WriteStringValue(CredentialsType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KerberosPasswordCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosPasswordCredentials(document.RootElement, options); - } - - internal static KerberosPasswordCredentials DeserializeKerberosPasswordCredentials(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - KerberosPasswordSecrets secrets = default; - string kerberosKdcAddress = default; - string kerberosPrincipal = default; - string kerberosRealm = default; - CredentialsType credentialsType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("secrets"u8)) - { - secrets = KerberosPasswordSecrets.DeserializeKerberosPasswordSecrets(property.Value, options); - continue; - } - if (property.NameEquals("kerberosKdcAddress"u8)) - { - kerberosKdcAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosPrincipal"u8)) - { - kerberosPrincipal = property.Value.GetString(); - continue; - } - if (property.NameEquals("kerberosRealm"u8)) - { - kerberosRealm = property.Value.GetString(); - continue; - } - if (property.NameEquals("credentialsType"u8)) - { - credentialsType = new CredentialsType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KerberosPasswordCredentials( - credentialsType, - serializedAdditionalRawData, - secrets, - kerberosKdcAddress, - kerberosPrincipal, - kerberosRealm); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support writing '{options.Format}' format."); - } - } - - KerberosPasswordCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosPasswordCredentials(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KerberosPasswordCredentials)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs deleted file mode 100644 index 453c346546686..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordCredentials.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosPasswordCredentials. - public partial class KerberosPasswordCredentials : MachineLearningDatastoreCredentials - { - /// Initializes a new instance of . - /// [Required] Kerberos password secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - /// , , or is null. - public KerberosPasswordCredentials(KerberosPasswordSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) - { - Argument.AssertNotNull(secrets, nameof(secrets)); - Argument.AssertNotNull(kerberosKdcAddress, nameof(kerberosKdcAddress)); - Argument.AssertNotNull(kerberosPrincipal, nameof(kerberosPrincipal)); - Argument.AssertNotNull(kerberosRealm, nameof(kerberosRealm)); - - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = CredentialsType.KerberosPassword; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// [Required] Kerberos password secrets. - /// [Required] IP Address or DNS HostName. - /// [Required] Kerberos Username. - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - internal KerberosPasswordCredentials(CredentialsType credentialsType, IDictionary serializedAdditionalRawData, KerberosPasswordSecrets secrets, string kerberosKdcAddress, string kerberosPrincipal, string kerberosRealm) : base(credentialsType, serializedAdditionalRawData) - { - Secrets = secrets; - KerberosKdcAddress = kerberosKdcAddress; - KerberosPrincipal = kerberosPrincipal; - KerberosRealm = kerberosRealm; - CredentialsType = credentialsType; - } - - /// Initializes a new instance of for deserialization. - internal KerberosPasswordCredentials() - { - } - - /// [Required] Kerberos password secrets. - public KerberosPasswordSecrets Secrets { get; set; } - /// [Required] IP Address or DNS HostName. - public string KerberosKdcAddress { get; set; } - /// [Required] Kerberos Username. - public string KerberosPrincipal { get; set; } - /// [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. - public string KerberosRealm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs deleted file mode 100644 index cb64bd7a046f2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class KerberosPasswordSecrets : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(KerberosPassword)) - { - if (KerberosPassword != null) - { - writer.WritePropertyName("kerberosPassword"u8); - writer.WriteStringValue(KerberosPassword); - } - else - { - writer.WriteNull("kerberosPassword"); - } - } - writer.WritePropertyName("secretsType"u8); - writer.WriteStringValue(SecretsType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - KerberosPasswordSecrets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeKerberosPasswordSecrets(document.RootElement, options); - } - - internal static KerberosPasswordSecrets DeserializeKerberosPasswordSecrets(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string kerberosPassword = default; - SecretsType secretsType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kerberosPassword"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - kerberosPassword = null; - continue; - } - kerberosPassword = property.Value.GetString(); - continue; - } - if (property.NameEquals("secretsType"u8)) - { - secretsType = new SecretsType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new KerberosPasswordSecrets(secretsType, serializedAdditionalRawData, kerberosPassword); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support writing '{options.Format}' format."); - } - } - - KerberosPasswordSecrets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeKerberosPasswordSecrets(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(KerberosPasswordSecrets)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs deleted file mode 100644 index 1ee397a9f8d81..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/KerberosPasswordSecrets.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The KerberosPasswordSecrets. - public partial class KerberosPasswordSecrets : MachineLearningDatastoreSecrets - { - /// Initializes a new instance of . - public KerberosPasswordSecrets() - { - SecretsType = SecretsType.KerberosPassword; - } - - /// Initializes a new instance of . - /// [Required] Credential type used to authentication with storage. - /// Keeps track of any properties unknown to the library. - /// Kerberos password secret. - internal KerberosPasswordSecrets(SecretsType secretsType, IDictionary serializedAdditionalRawData, string kerberosPassword) : base(secretsType, serializedAdditionalRawData) - { - KerberosPassword = kerberosPassword; - SecretsType = secretsType; - } - - /// Kerberos password secret. - public string KerberosPassword { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs deleted file mode 100644 index e60bcbbc4c1db..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategory.Serialization.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class LabelCategory : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LabelCategory)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Classes)) - { - if (Classes != null) - { - writer.WritePropertyName("classes"u8); - writer.WriteStartObject(); - foreach (var item in Classes) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("classes"); - } - } - if (Optional.IsDefined(DisplayName)) - { - if (DisplayName != null) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - else - { - writer.WriteNull("displayName"); - } - } - if (Optional.IsDefined(MultiSelect)) - { - writer.WritePropertyName("multiSelect"u8); - writer.WriteStringValue(MultiSelect.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LabelCategory IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LabelCategory)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelCategory(document.RootElement, options); - } - - internal static LabelCategory DeserializeLabelCategory(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary classes = default; - string displayName = default; - LabelCategoryMultiSelect? multiSelect = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("classes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - classes = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, LabelClass.DeserializeLabelClass(property0.Value, options)); - } - classes = dictionary; - continue; - } - if (property.NameEquals("displayName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - displayName = null; - continue; - } - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("multiSelect"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - multiSelect = new LabelCategoryMultiSelect(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new LabelCategory(classes ?? new ChangeTrackingDictionary(), displayName, multiSelect, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(LabelCategory)} does not support writing '{options.Format}' format."); - } - } - - LabelCategory IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelCategory(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LabelCategory)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs deleted file mode 100644 index d224ba93ab538..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelCategoryMultiSelect.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Whether multiSelect is enabled. - public readonly partial struct LabelCategoryMultiSelect : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LabelCategoryMultiSelect(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static LabelCategoryMultiSelect Enabled { get; } = new LabelCategoryMultiSelect(EnabledValue); - /// Disabled. - public static LabelCategoryMultiSelect Disabled { get; } = new LabelCategoryMultiSelect(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(LabelCategoryMultiSelect left, LabelCategoryMultiSelect right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LabelCategoryMultiSelect left, LabelCategoryMultiSelect right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LabelCategoryMultiSelect(string value) => new LabelCategoryMultiSelect(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LabelCategoryMultiSelect other && Equals(other); - /// - public bool Equals(LabelCategoryMultiSelect other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs deleted file mode 100644 index 35c47dcbb512d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Properties of a labeling job for image data. - public partial class LabelingJobImageProperties : LabelingJobMediaProperties - { - /// Initializes a new instance of . - public LabelingJobImageProperties() - { - MediaType = MediaType.Image; - } - - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - /// Annotation type of image labeling job. - internal LabelingJobImageProperties(MediaType mediaType, IDictionary serializedAdditionalRawData, ImageAnnotationType? annotationType) : base(mediaType, serializedAdditionalRawData) - { - AnnotationType = annotationType; - MediaType = mediaType; - } - - /// Annotation type of image labeling job. - public ImageAnnotationType? AnnotationType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs deleted file mode 100644 index 1666fe72a4242..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownLabelingJobMediaProperties))] - public partial class LabelingJobMediaProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - LabelingJobMediaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); - } - - internal static LabelingJobMediaProperties DeserializeLabelingJobMediaProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("mediaType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Image": return LabelingJobImageProperties.DeserializeLabelingJobImageProperties(element, options); - case "Text": return LabelingJobTextProperties.DeserializeLabelingJobTextProperties(element, options); - } - } - return UnknownLabelingJobMediaProperties.DeserializeUnknownLabelingJobMediaProperties(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{options.Format}' format."); - } - } - - LabelingJobMediaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs deleted file mode 100644 index 719007a4923bf..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobMediaProperties.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Properties of a labeling job - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class LabelingJobMediaProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected LabelingJobMediaProperties() - { - } - - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - internal LabelingJobMediaProperties(MediaType mediaType, IDictionary serializedAdditionalRawData) - { - MediaType = mediaType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Media type of the job. - internal MediaType MediaType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs deleted file mode 100644 index 84a82cf2dd8f4..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobProperties.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Labeling job definition. - public partial class LabelingJobProperties : MachineLearningJobProperties - { - /// Initializes a new instance of . - public LabelingJobProperties() - { - LabelCategories = new ChangeTrackingDictionary(); - StatusMessages = new ChangeTrackingList(); - JobType = JobType.Labeling; - } - - /// Initializes a new instance of . - /// The asset description text. - /// The asset property dictionary. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Keeps track of any properties unknown to the library. - /// ARM resource ID of the component resource. - /// ARM resource ID of the compute resource. - /// Display name of job. - /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. - /// - /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. - /// Defaults to AmlToken if null. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Is the asset archived?. - /// [Required] Specifies the type of job. - /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. - /// - /// List of JobEndpoints. - /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - /// - /// Status of the job. - /// Created time of the job in UTC timezone. - /// Configuration of data used in the job. - /// Labeling instructions of the job. - /// Label categories of the job. - /// - /// Media type specific properties in the job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// - /// Configuration of MLAssist feature in the job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Progress metrics of the job. - /// Internal id of the job(Previously called project). - /// Specifies the labeling job provisioning state. - /// Status messages of the job. - internal LabelingJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, DateTimeOffset? createdOn, LabelingDataConfiguration dataConfiguration, LabelingJobInstructions jobInstructions, IDictionary labelCategories, LabelingJobMediaProperties labelingJobMediaProperties, MachineLearningAssistConfiguration mlAssistConfiguration, ProgressMetrics progressMetrics, Guid? projectId, JobProvisioningState? provisioningState, IReadOnlyList statusMessages) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) - { - CreatedOn = createdOn; - DataConfiguration = dataConfiguration; - JobInstructions = jobInstructions; - LabelCategories = labelCategories; - LabelingJobMediaProperties = labelingJobMediaProperties; - MlAssistConfiguration = mlAssistConfiguration; - ProgressMetrics = progressMetrics; - ProjectId = projectId; - ProvisioningState = provisioningState; - StatusMessages = statusMessages; - JobType = jobType; - } - - /// Created time of the job in UTC timezone. - public DateTimeOffset? CreatedOn { get; } - /// Configuration of data used in the job. - public LabelingDataConfiguration DataConfiguration { get; set; } - /// Labeling instructions of the job. - internal LabelingJobInstructions JobInstructions { get; set; } - /// The link to a page with detailed labeling instructions for labelers. - public Uri JobInstructionsUri - { - get => JobInstructions is null ? default : JobInstructions.Uri; - set - { - if (JobInstructions is null) - JobInstructions = new LabelingJobInstructions(); - JobInstructions.Uri = value; - } - } - - /// Label categories of the job. - public IDictionary LabelCategories { get; set; } - /// - /// Media type specific properties in the job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public LabelingJobMediaProperties LabelingJobMediaProperties { get; set; } - /// - /// Configuration of MLAssist feature in the job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public MachineLearningAssistConfiguration MlAssistConfiguration { get; set; } - /// Progress metrics of the job. - public ProgressMetrics ProgressMetrics { get; } - /// Internal id of the job(Previously called project). - public Guid? ProjectId { get; } - /// Specifies the labeling job provisioning state. - public JobProvisioningState? ProvisioningState { get; } - /// Status messages of the job. - public IReadOnlyList StatusMessages { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs deleted file mode 100644 index e1aa8f0f2770e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Properties of a labeling job for text data. - public partial class LabelingJobTextProperties : LabelingJobMediaProperties - { - /// Initializes a new instance of . - public LabelingJobTextProperties() - { - MediaType = MediaType.Text; - } - - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - /// Annotation type of text labeling job. - internal LabelingJobTextProperties(MediaType mediaType, IDictionary serializedAdditionalRawData, TextAnnotationType? annotationType) : base(mediaType, serializedAdditionalRawData) - { - AnnotationType = annotationType; - MediaType = mediaType; - } - - /// Annotation type of text labeling job. - public TextAnnotationType? AnnotationType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs deleted file mode 100644 index 37e8377741f17..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogTrainingMetric.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The LogTrainingMetric. - public readonly partial struct LogTrainingMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LogTrainingMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnableValue = "Enable"; - private const string DisableValue = "Disable"; - - /// Enable compute and log training metrics. - public static LogTrainingMetric Enable { get; } = new LogTrainingMetric(EnableValue); - /// Disable compute and log training metrics. - public static LogTrainingMetric Disable { get; } = new LogTrainingMetric(DisableValue); - /// Determines if two values are the same. - public static bool operator ==(LogTrainingMetric left, LogTrainingMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LogTrainingMetric left, LogTrainingMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LogTrainingMetric(string value) => new LogTrainingMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LogTrainingMetric other && Equals(other); - /// - public bool Equals(LogTrainingMetric other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs deleted file mode 100644 index 34c93ab5414e4..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LogValidationLoss.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The LogValidationLoss. - public readonly partial struct LogValidationLoss : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public LogValidationLoss(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnableValue = "Enable"; - private const string DisableValue = "Disable"; - - /// Enable compute and log validation metrics. - public static LogValidationLoss Enable { get; } = new LogValidationLoss(EnableValue); - /// Disable compute and log validation metrics. - public static LogValidationLoss Disable { get; } = new LogValidationLoss(DisableValue); - /// Determines if two values are the same. - public static bool operator ==(LogValidationLoss left, LogValidationLoss right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LogValidationLoss left, LogValidationLoss right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LogValidationLoss(string value) => new LogValidationLoss(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LogValidationLoss other && Equals(other); - /// - public bool Equals(LogValidationLoss other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs deleted file mode 100644 index ce7c38b2bf326..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Labeling MLAssist configuration definition when MLAssist is disabled. - public partial class MLAssistConfigurationDisabled : MachineLearningAssistConfiguration - { - /// Initializes a new instance of . - public MLAssistConfigurationDisabled() - { - MlAssist = MLAssistConfigurationType.Disabled; - } - - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. - /// Keeps track of any properties unknown to the library. - internal MLAssistConfigurationDisabled(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData) : base(mlAssist, serializedAdditionalRawData) - { - MlAssist = mlAssist; - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs deleted file mode 100644 index ed666300bfe34..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MLAssistConfigurationType. - internal readonly partial struct MLAssistConfigurationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MLAssistConfigurationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static MLAssistConfigurationType Enabled { get; } = new MLAssistConfigurationType(EnabledValue); - /// Disabled. - public static MLAssistConfigurationType Disabled { get; } = new MLAssistConfigurationType(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(MLAssistConfigurationType left, MLAssistConfigurationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MLAssistConfigurationType left, MLAssistConfigurationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MLAssistConfigurationType(string value) => new MLAssistConfigurationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MLAssistConfigurationType other && Equals(other); - /// - public bool Equals(MLAssistConfigurationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs index 119b7a2c53f33..4f4bfc4e577cc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -134,7 +122,6 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso { return null; } - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -144,16 +131,6 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +200,6 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs index 3e83c00d7450b..43981242e8a79 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs @@ -23,21 +23,17 @@ public MachineLearningAssetBase() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. - internal MachineLearningAssetBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived) : base(description, properties, tags, serializedAdditionalRawData) + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + internal MachineLearningAssetBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived) : base(description, properties, tags, serializedAdditionalRawData) { - AutoDeleteSetting = autoDeleteSetting; IsAnonymous = isAnonymous; IsArchived = isArchived; } - /// Specifies the lifecycle setting of managed data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. + /// If the name version are system generated (anonymous registration). public bool? IsAnonymous { get; set; } - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// Is the asset archived?. public bool? IsArchived { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs deleted file mode 100644 index ec3628d2e5ec4..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownMLAssistConfiguration))] - public partial class MachineLearningAssistConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MachineLearningAssistConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); - } - - internal static MachineLearningAssistConfiguration DeserializeMachineLearningAssistConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("mlAssist", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Disabled": return MLAssistConfigurationDisabled.DeserializeMLAssistConfigurationDisabled(element, options); - case "Enabled": return MachineLearningAssistEnabledConfiguration.DeserializeMachineLearningAssistEnabledConfiguration(element, options); - } - } - return UnknownMLAssistConfiguration.DeserializeUnknownMLAssistConfiguration(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{options.Format}' format."); - } - } - - MachineLearningAssistConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs deleted file mode 100644 index 74b8cdc8735cb..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.Serialization.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class MachineLearningAssistEnabledConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("inferencingComputeBinding"u8); - writer.WriteStringValue(InferencingComputeBinding); - writer.WritePropertyName("trainingComputeBinding"u8); - writer.WriteStringValue(TrainingComputeBinding); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MachineLearningAssistEnabledConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningAssistEnabledConfiguration(document.RootElement, options); - } - - internal static MachineLearningAssistEnabledConfiguration DeserializeMachineLearningAssistEnabledConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string inferencingComputeBinding = default; - string trainingComputeBinding = default; - MLAssistConfigurationType mlAssist = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inferencingComputeBinding"u8)) - { - inferencingComputeBinding = property.Value.GetString(); - continue; - } - if (property.NameEquals("trainingComputeBinding"u8)) - { - trainingComputeBinding = property.Value.GetString(); - continue; - } - if (property.NameEquals("mlAssist"u8)) - { - mlAssist = new MLAssistConfigurationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningAssistEnabledConfiguration(mlAssist, serializedAdditionalRawData, inferencingComputeBinding, trainingComputeBinding); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support writing '{options.Format}' format."); - } - } - - MachineLearningAssistEnabledConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningAssistEnabledConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineLearningAssistEnabledConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs deleted file mode 100644 index 8f21b5bcf57c1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistEnabledConfiguration.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Labeling MLAssist configuration definition when MLAssist is enabled. - public partial class MachineLearningAssistEnabledConfiguration : MachineLearningAssistConfiguration - { - /// Initializes a new instance of . - /// [Required] AML compute binding used in inferencing. - /// [Required] AML compute binding used in training. - /// or is null. - public MachineLearningAssistEnabledConfiguration(string inferencingComputeBinding, string trainingComputeBinding) - { - Argument.AssertNotNull(inferencingComputeBinding, nameof(inferencingComputeBinding)); - Argument.AssertNotNull(trainingComputeBinding, nameof(trainingComputeBinding)); - - InferencingComputeBinding = inferencingComputeBinding; - TrainingComputeBinding = trainingComputeBinding; - MlAssist = MLAssistConfigurationType.Enabled; - } - - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. - /// Keeps track of any properties unknown to the library. - /// [Required] AML compute binding used in inferencing. - /// [Required] AML compute binding used in training. - internal MachineLearningAssistEnabledConfiguration(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData, string inferencingComputeBinding, string trainingComputeBinding) : base(mlAssist, serializedAdditionalRawData) - { - InferencingComputeBinding = inferencingComputeBinding; - TrainingComputeBinding = trainingComputeBinding; - MlAssist = mlAssist; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningAssistEnabledConfiguration() - { - } - - /// [Required] AML compute binding used in inferencing. - public string InferencingComputeBinding { get; set; } - /// [Required] AML compute binding used in training. - public string TrainingComputeBinding { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs index a5b620e0f34b4..b9de3228e18b5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs @@ -107,18 +107,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -219,7 +207,6 @@ internal static MachineLearningAzureBlobDatastore DeserializeMachineLearningAzur string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -307,16 +294,6 @@ internal static MachineLearningAzureBlobDatastore DeserializeMachineLearningAzur datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -379,7 +356,6 @@ internal static MachineLearningAzureBlobDatastore DeserializeMachineLearningAzur serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, accountName, containerName, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs index 5595b986b1212..dc6f88f223dc6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureBlobDatastore : MachineLearningDatastor /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// is null. public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials credentials) : base(credentials) @@ -35,10 +35,9 @@ public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials cre /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Storage account name. /// Storage account container name. @@ -47,7 +46,7 @@ public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials cre /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureBlobDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string accountName, string containerName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureBlobDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string containerName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { AccountName = accountName; ContainerName = containerName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs index 765b9291103a4..0b7cd57f708f3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs @@ -61,18 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -170,7 +158,6 @@ internal static MachineLearningAzureDataLakeGen1Datastore DeserializeMachineLear string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -223,16 +210,6 @@ internal static MachineLearningAzureDataLakeGen1Datastore DeserializeMachineLear datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -295,7 +272,6 @@ internal static MachineLearningAzureDataLakeGen1Datastore DeserializeMachineLear serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, serviceDataAccessAuthIdentity, storeName, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs index cea6fa6abb1a9..5a73a38d2ea47 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureDataLakeGen1Datastore : MachineLearning /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Azure Data Lake store name. /// or is null. @@ -38,16 +38,15 @@ public MachineLearningAzureDataLakeGen1Datastore(MachineLearningDatastoreCredent /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// Indicates which identity to use to authenticate service data access to customer's storage. /// [Required] Azure Data Lake store name. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureDataLakeGen1Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string storeName, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureDataLakeGen1Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string storeName, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { ServiceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; StoreName = storeName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs index 9ab950ac6b02d..befcefaa22cd0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs @@ -87,18 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -199,7 +187,6 @@ internal static MachineLearningAzureDataLakeGen2Datastore DeserializeMachineLear string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -277,16 +264,6 @@ internal static MachineLearningAzureDataLakeGen2Datastore DeserializeMachineLear datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -349,7 +326,6 @@ internal static MachineLearningAzureDataLakeGen2Datastore DeserializeMachineLear serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, accountName, endpoint, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs index 0cd706fe22a78..81af87c094bc7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureDataLakeGen2Datastore : MachineLearning /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage account name. /// [Required] The name of the Data Lake Gen2 filesystem. @@ -41,10 +41,9 @@ public MachineLearningAzureDataLakeGen2Datastore(MachineLearningDatastoreCredent /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -53,7 +52,7 @@ public MachineLearningAzureDataLakeGen2Datastore(MachineLearningDatastoreCredent /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureDataLakeGen2Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string accountName, string endpoint, string filesystem, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureDataLakeGen2Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string endpoint, string filesystem, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { AccountName = accountName; Endpoint = endpoint; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs index 9490d7877866d..2d7fac71ee08b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs @@ -87,18 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -199,7 +187,6 @@ internal static MachineLearningAzureFileDatastore DeserializeMachineLearningAzur string subscriptionId = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -277,16 +264,6 @@ internal static MachineLearningAzureFileDatastore DeserializeMachineLearningAzur datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -349,7 +326,6 @@ internal static MachineLearningAzureFileDatastore DeserializeMachineLearningAzur serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, accountName, endpoint, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs index c0f8462e70ed0..92af4aea614e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs @@ -17,7 +17,7 @@ public partial class MachineLearningAzureFileDatastore : MachineLearningDatastor /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage account name. /// [Required] The name of the Azure file share that the datastore points to. @@ -41,10 +41,9 @@ public MachineLearningAzureFileDatastore(MachineLearningDatastoreCredentials cre /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. @@ -53,7 +52,7 @@ public MachineLearningAzureFileDatastore(MachineLearningDatastoreCredentials cre /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Resource Group name. /// Azure Subscription Id. - internal MachineLearningAzureFileDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, string accountName, string endpoint, string fileShareName, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal MachineLearningAzureFileDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string endpoint, string fileShareName, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { AccountName = accountName; Endpoint = endpoint; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs index 858954a1649a9..6de796fcd4b91 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs @@ -21,7 +21,7 @@ public MachineLearningBatchDeploymentProperties() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs index 5619958b01772..1bc9927fd9ff4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -153,7 +141,6 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC } Uri codeUri = default; RegistryAssetProvisioningState? provisioningState = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -182,16 +169,6 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -261,7 +238,6 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, codeUri, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs index e4652f1a1eefe..7699b04ba1306 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs @@ -23,12 +23,11 @@ public MachineLearningCodeVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Uri where code is located. /// Provisioning state for the code version. - internal MachineLearningCodeVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, Uri codeUri, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningCodeVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, Uri codeUri, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { CodeUri = codeUri; ProvisioningState = provisioningState; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs index 3b89660666154..658beadf1bf28 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - if (Optional.IsDefined(AutologgerSettings)) - { - if (AutologgerSettings != null) - { - writer.WritePropertyName("autologgerSettings"u8); - writer.WriteObjectValue(AutologgerSettings, options); - } - else - { - writer.WriteNull("autologgerSettings"); - } - } if (Optional.IsDefined(CodeId)) { if (CodeId != null) @@ -240,24 +228,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -367,7 +337,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J { return null; } - AutologgerSettings autologgerSettings = default; ResourceIdentifier codeId = default; string command = default; MachineLearningDistributionConfiguration distribution = default; @@ -387,7 +356,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -397,16 +365,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("autologgerSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autologgerSettings = null; - continue; - } - autologgerSettings = AutologgerSettings.DeserializeAutologgerSettings(property.Value, options); - continue; - } if (property.NameEquals("codeId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -590,21 +548,6 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -688,10 +631,8 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, - autologgerSettings, codeId, command, distribution, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs index eb98f61d42e47..a321da1c827da 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs @@ -49,19 +49,17 @@ public MachineLearningCommandJob(string command, ResourceIdentifier environmentI /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// ARM resource ID of the code asset. /// [Required] The command to execute on startup of the job. eg. "python train.py". /// - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// [Required] The ARM resource ID of the Environment specification for the job. /// Environment variables included in the job. @@ -79,9 +77,8 @@ public MachineLearningCommandJob(string command, ResourceIdentifier environmentI /// Input parameters. /// Queue settings for the job. /// Compute Resource configuration for the job. - internal MachineLearningCommandJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, AutologgerSettings autologgerSettings, ResourceIdentifier codeId, string command, MachineLearningDistributionConfiguration distribution, ResourceIdentifier environmentId, IDictionary environmentVariables, IDictionary inputs, MachineLearningCommandJobLimits limits, IDictionary outputs, BinaryData parameters, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal MachineLearningCommandJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, ResourceIdentifier codeId, string command, MachineLearningDistributionConfiguration distribution, ResourceIdentifier environmentId, IDictionary environmentVariables, IDictionary inputs, MachineLearningCommandJobLimits limits, IDictionary outputs, BinaryData parameters, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { - AutologgerSettings = autologgerSettings; CodeId = codeId; Command = command; Distribution = distribution; @@ -101,26 +98,14 @@ internal MachineLearningCommandJob() { } - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. - internal AutologgerSettings AutologgerSettings { get; set; } - /// [Required] Indicates whether mlflow autologger is enabled. - public MachineLearningFlowAutoLoggerState? MlflowAutologger - { - get => AutologgerSettings is null ? default(MachineLearningFlowAutoLoggerState?) : AutologgerSettings.MlflowAutologger; - set - { - AutologgerSettings = value.HasValue ? new AutologgerSettings(value.Value) : null; - } - } - /// ARM resource ID of the code asset. public ResourceIdentifier CodeId { get; set; } /// [Required] The command to execute on startup of the job. eg. "python train.py". public string Command { get; set; } /// - /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public MachineLearningDistributionConfiguration Distribution { get; set; } /// [Required] The ARM resource ID of the Environment specification for the job. @@ -173,7 +158,19 @@ public MachineLearningFlowAutoLoggerState? MlflowAutologger /// public BinaryData Parameters { get; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// Compute Resource configuration for the job. public MachineLearningJobResourceConfiguration Resources { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs index 67393e125c15f..5e4f6c925edf8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs @@ -50,30 +50,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -172,8 +148,6 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear } BinaryData componentSpec = default; RegistryAssetProvisioningState? provisioningState = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -202,26 +176,6 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -291,12 +245,10 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, componentSpec, - provisioningState, - stage); + provisioningState); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs index 9535a131f38e4..56437e718d34e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs @@ -23,20 +23,17 @@ public MachineLearningComponentVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// /// Defines Component definition details. /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> /// /// Provisioning state for the component version. - /// Stage in the component lifecycle. - internal MachineLearningComponentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, BinaryData componentSpec, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningComponentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, BinaryData componentSpec, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { ComponentSpec = componentSpec; ProvisioningState = provisioningState; - Stage = stage; } /// @@ -73,7 +70,5 @@ internal MachineLearningComponentVersionProperties(string description, IDictiona public BinaryData ComponentSpec { get; set; } /// Provisioning state for the component version. public RegistryAssetProvisioningState? ProvisioningState { get; } - /// Stage in the component lifecycle. - public string Stage { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs index e0328ddb0c164..a7b48637fc36c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs @@ -46,6 +46,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("mountAction"u8); writer.WriteStringValue(MountAction.Value.ToString()); } + if (Optional.IsDefined(MountMode)) + { + writer.WritePropertyName("mountMode"u8); + writer.WriteStringValue(MountMode.Value.ToString()); + } if (Optional.IsDefined(CreatedBy)) { writer.WritePropertyName("createdBy"u8); @@ -113,6 +118,7 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni MachineLearningSourceType? sourceType = default; string mountName = default; MachineLearningMountAction? mountAction = default; + MountMode? mountMode = default; string createdBy = default; string mountPath = default; MachineLearningMountState? mountState = default; @@ -150,6 +156,15 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni mountAction = new MachineLearningMountAction(property.Value.GetString()); continue; } + if (property.NameEquals("mountMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mountMode = new MountMode(property.Value.GetString()); + continue; + } if (property.NameEquals("createdBy"u8)) { createdBy = property.Value.GetString(); @@ -194,6 +209,7 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni sourceType, mountName, mountAction, + mountMode, createdBy, mountPath, mountState, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs index 0810ecad2bbd0..bed98f0652e2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs @@ -46,7 +46,7 @@ public partial class MachineLearningComputeInstanceDataMount private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MachineLearningComputeInstanceDataMount() + public MachineLearningComputeInstanceDataMount() { } @@ -55,18 +55,20 @@ internal MachineLearningComputeInstanceDataMount() /// Data source type. /// name of the ComputeInstance data mount. /// Mount Action. + /// Mount Mode. /// who this data mount created by. /// Path of this data mount. /// Mount state. /// The time when the disk mounted. /// Error of this data mount. /// Keeps track of any properties unknown to the library. - internal MachineLearningComputeInstanceDataMount(string source, MachineLearningSourceType? sourceType, string mountName, MachineLearningMountAction? mountAction, string createdBy, string mountPath, MachineLearningMountState? mountState, DateTimeOffset? mountedOn, string error, IDictionary serializedAdditionalRawData) + internal MachineLearningComputeInstanceDataMount(string source, MachineLearningSourceType? sourceType, string mountName, MachineLearningMountAction? mountAction, MountMode? mountMode, string createdBy, string mountPath, MachineLearningMountState? mountState, DateTimeOffset? mountedOn, string error, IDictionary serializedAdditionalRawData) { Source = source; SourceType = sourceType; MountName = mountName; MountAction = mountAction; + MountMode = mountMode; CreatedBy = createdBy; MountPath = mountPath; MountState = mountState; @@ -76,22 +78,24 @@ internal MachineLearningComputeInstanceDataMount(string source, MachineLearningS } /// Source of the ComputeInstance data mount. - public string Source { get; } + public string Source { get; set; } /// Data source type. - public MachineLearningSourceType? SourceType { get; } + public MachineLearningSourceType? SourceType { get; set; } /// name of the ComputeInstance data mount. - public string MountName { get; } + public string MountName { get; set; } /// Mount Action. - public MachineLearningMountAction? MountAction { get; } + public MachineLearningMountAction? MountAction { get; set; } + /// Mount Mode. + public MountMode? MountMode { get; set; } /// who this data mount created by. - public string CreatedBy { get; } + public string CreatedBy { get; set; } /// Path of this data mount. - public string MountPath { get; } + public string MountPath { get; set; } /// Mount state. - public MachineLearningMountState? MountState { get; } + public MachineLearningMountState? MountState { get; set; } /// The time when the disk mounted. - public DateTimeOffset? MountedOn { get; } + public DateTimeOffset? MountedOn { get; set; } /// Error of this data mount. - public string Error { get; } + public string Error { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs index eea3fa2910e96..42dd75d59021c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs @@ -141,6 +141,54 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WriteNull("computeInstanceAuthorizationType"); } } + if (Optional.IsDefined(EnableOSPatching)) + { + if (EnableOSPatching != null) + { + writer.WritePropertyName("enableOSPatching"u8); + writer.WriteBooleanValue(EnableOSPatching.Value); + } + else + { + writer.WriteNull("enableOSPatching"); + } + } + if (Optional.IsDefined(EnableRootAccess)) + { + if (EnableRootAccess != null) + { + writer.WritePropertyName("enableRootAccess"u8); + writer.WriteBooleanValue(EnableRootAccess.Value); + } + else + { + writer.WriteNull("enableRootAccess"); + } + } + if (Optional.IsDefined(EnableSso)) + { + if (EnableSso != null) + { + writer.WritePropertyName("enableSSO"u8); + writer.WriteBooleanValue(EnableSso.Value); + } + else + { + writer.WriteNull("enableSSO"); + } + } + if (Optional.IsDefined(ReleaseQuotaOnStop)) + { + if (ReleaseQuotaOnStop != null) + { + writer.WritePropertyName("releaseQuotaOnStop"u8); + writer.WriteBooleanValue(ReleaseQuotaOnStop.Value); + } + else + { + writer.WriteNull("releaseQuotaOnStop"); + } + } if (Optional.IsDefined(PersonalComputeInstanceSettings)) { if (PersonalComputeInstanceSettings != null) @@ -313,6 +361,10 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn IReadOnlyList errors = default; MachineLearningComputeInstanceState? state = default; MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType = default; + bool? enableOSPatching = default; + bool? enableRootAccess = default; + bool? enableSso = default; + bool? releaseQuotaOnStop = default; PersonalComputeInstanceSettings personalComputeInstanceSettings = default; SetupScripts setupScripts = default; MachineLearningComputeInstanceLastOperation lastOperation = default; @@ -460,6 +512,46 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn computeInstanceAuthorizationType = new MachineLearningComputeInstanceAuthorizationType(property.Value.GetString()); continue; } + if (property.NameEquals("enableOSPatching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableOSPatching = null; + continue; + } + enableOSPatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableRootAccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableRootAccess = null; + continue; + } + enableRootAccess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableSSO"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableSso = null; + continue; + } + enableSso = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("releaseQuotaOnStop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + releaseQuotaOnStop = null; + continue; + } + releaseQuotaOnStop = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("personalComputeInstanceSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -589,6 +681,10 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn errors ?? new ChangeTrackingList(), state, computeInstanceAuthorizationType, + enableOSPatching, + enableRootAccess, + enableSso, + releaseQuotaOnStop, personalComputeInstanceSettings, setupScripts, lastOperation, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs index 25d507075a028..dca78aeb8fbe3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs @@ -71,6 +71,10 @@ public MachineLearningComputeInstanceProperties() /// Collection of errors encountered on this ComputeInstance. /// The current state of this ComputeInstance. /// The Compute Instance Authorization type. Available values are personal (default). + /// Enable Auto OS Patching. Possible values are: true, false. + /// Enable root access. Possible values are: true, false. + /// Enable SSO (single sign on). Possible values are: true, false. + /// Release quota if compute instance stopped. Possible values are: true - release quota if compute instance stopped. false - don't release quota when compute instance stopped. /// Settings for a personal compute instance. /// Details of customized scripts to execute for setting up the cluster. /// The last operation on ComputeInstance. @@ -82,7 +86,7 @@ public MachineLearningComputeInstanceProperties() /// Describes informations of dataMounts on this ComputeInstance. /// ComputeInstance version. /// Keeps track of any properties unknown to the library. - internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subnet, MachineLearningApplicationSharingPolicy? applicationSharingPolicy, ComputeInstanceAutologgerSettings autologgerSettings, MachineLearningComputeInstanceSshSettings sshSettings, IList customServices, ImageMetadata osImageMetadata, MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints, IReadOnlyList applications, MachineLearningComputeInstanceCreatedBy createdBy, IReadOnlyList errors, MachineLearningComputeInstanceState? state, MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType, PersonalComputeInstanceSettings personalComputeInstanceSettings, SetupScripts setupScriptsSettings, MachineLearningComputeInstanceLastOperation lastOperation, ComputeSchedules schedules, string idleTimeBeforeShutdown, bool? enableNodePublicIP, IReadOnlyList containers, IReadOnlyList dataDisks, IReadOnlyList dataMounts, ComputeInstanceVersion versions, IDictionary serializedAdditionalRawData) + internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subnet, MachineLearningApplicationSharingPolicy? applicationSharingPolicy, ComputeInstanceAutologgerSettings autologgerSettings, MachineLearningComputeInstanceSshSettings sshSettings, IList customServices, ImageMetadata osImageMetadata, MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints, IReadOnlyList applications, MachineLearningComputeInstanceCreatedBy createdBy, IReadOnlyList errors, MachineLearningComputeInstanceState? state, MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType, bool? enableOSPatching, bool? enableRootAccess, bool? enableSso, bool? releaseQuotaOnStop, PersonalComputeInstanceSettings personalComputeInstanceSettings, SetupScripts setupScriptsSettings, MachineLearningComputeInstanceLastOperation lastOperation, ComputeSchedules schedules, string idleTimeBeforeShutdown, bool? enableNodePublicIP, IReadOnlyList containers, IReadOnlyList dataDisks, IReadOnlyList dataMounts, ComputeInstanceVersion versions, IDictionary serializedAdditionalRawData) { VmSize = vmSize; Subnet = subnet; @@ -97,6 +101,10 @@ internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subn Errors = errors; State = state; ComputeInstanceAuthorizationType = computeInstanceAuthorizationType; + EnableOSPatching = enableOSPatching; + EnableRootAccess = enableRootAccess; + EnableSso = enableSso; + ReleaseQuotaOnStop = releaseQuotaOnStop; PersonalComputeInstanceSettings = personalComputeInstanceSettings; SetupScriptsSettings = setupScriptsSettings; LastOperation = lastOperation; @@ -155,6 +163,14 @@ public MachineLearningFlowAutoLogger? MlflowAutologger public MachineLearningComputeInstanceState? State { get; } /// The Compute Instance Authorization type. Available values are personal (default). public MachineLearningComputeInstanceAuthorizationType? ComputeInstanceAuthorizationType { get; set; } + /// Enable Auto OS Patching. Possible values are: true, false. + public bool? EnableOSPatching { get; set; } + /// Enable root access. Possible values are: true, false. + public bool? EnableRootAccess { get; set; } + /// Enable SSO (single sign on). Possible values are: true, false. + public bool? EnableSso { get; set; } + /// Release quota if compute instance stopped. Possible values are: true - release quota if compute instance stopped. false - don't release quota when compute instance stopped. + public bool? ReleaseQuotaOnStop { get; set; } /// Settings for a personal compute instance. internal PersonalComputeInstanceSettings PersonalComputeInstanceSettings { get; set; } /// A user explicitly assigned to a personal compute instance. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs index 924e9af414edb..5cd4f18a8ef4c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs @@ -27,6 +27,7 @@ public MachineLearningComputeInstanceState(string value) private const string DeletingValue = "Deleting"; private const string RunningValue = "Running"; private const string RestartingValue = "Restarting"; + private const string ResizingValue = "Resizing"; private const string JobRunningValue = "JobRunning"; private const string SettingUpValue = "SettingUp"; private const string SetupFailedValue = "SetupFailed"; @@ -48,6 +49,8 @@ public MachineLearningComputeInstanceState(string value) public static MachineLearningComputeInstanceState Running { get; } = new MachineLearningComputeInstanceState(RunningValue); /// Restarting. public static MachineLearningComputeInstanceState Restarting { get; } = new MachineLearningComputeInstanceState(RestartingValue); + /// Resizing. + public static MachineLearningComputeInstanceState Resizing { get; } = new MachineLearningComputeInstanceState(ResizingValue); /// JobRunning. public static MachineLearningComputeInstanceState JobRunning { get; } = new MachineLearningComputeInstanceState(JobRunningValue); /// SettingUp. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs index e2fa55e206e29..107f62fa35b0e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.Serialization.cs @@ -115,7 +115,7 @@ internal static MachineLearningComputeStartStopSchedule DeserializeMachineLearni MachineLearningComputeProvisioningStatus? provisioningStatus = default; MachineLearningScheduleStatus? status = default; MachineLearningComputePowerAction? action = default; - MachineLearningTriggerType? triggerType = default; + ComputeTriggerType? triggerType = default; ComputeStartStopRecurrenceSchedule recurrence = default; ComputeStartStopCronSchedule cron = default; MachineLearningScheduleBase schedule = default; @@ -166,7 +166,7 @@ internal static MachineLearningComputeStartStopSchedule DeserializeMachineLearni { continue; } - triggerType = new MachineLearningTriggerType(property.Value.GetString()); + triggerType = new ComputeTriggerType(property.Value.GetString()); continue; } if (property.NameEquals("recurrence"u8)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs index 620c9ad267804..bbca62bc9960e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeStartStopSchedule.cs @@ -60,7 +60,7 @@ public MachineLearningComputeStartStopSchedule() /// Required if triggerType is Cron. /// [Deprecated] Not used any more. /// Keeps track of any properties unknown to the library. - internal MachineLearningComputeStartStopSchedule(string id, MachineLearningComputeProvisioningStatus? provisioningStatus, MachineLearningScheduleStatus? status, MachineLearningComputePowerAction? action, MachineLearningTriggerType? triggerType, ComputeStartStopRecurrenceSchedule recurrenceSchedule, ComputeStartStopCronSchedule cronSchedule, MachineLearningScheduleBase schedule, IDictionary serializedAdditionalRawData) + internal MachineLearningComputeStartStopSchedule(string id, MachineLearningComputeProvisioningStatus? provisioningStatus, MachineLearningScheduleStatus? status, MachineLearningComputePowerAction? action, ComputeTriggerType? triggerType, ComputeStartStopRecurrenceSchedule recurrenceSchedule, ComputeStartStopCronSchedule cronSchedule, MachineLearningScheduleBase schedule, IDictionary serializedAdditionalRawData) { Id = id; ProvisioningStatus = provisioningStatus; @@ -82,7 +82,7 @@ internal MachineLearningComputeStartStopSchedule(string id, MachineLearningCompu /// [Required] The compute power action. public MachineLearningComputePowerAction? Action { get; set; } /// [Required] The schedule trigger type. - public MachineLearningTriggerType? TriggerType { get; set; } + public ComputeTriggerType? TriggerType { get; set; } /// Required if triggerType is Recurrence. public ComputeStartStopRecurrenceSchedule RecurrenceSchedule { get; set; } /// Required if triggerType is Cron. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs index e427c9b0f81e7..0408bdfbea50b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionAuthType.cs @@ -27,10 +27,13 @@ public MachineLearningConnectionAuthType(string value) private const string UsernamePasswordValue = "UsernamePassword"; private const string NoneValue = "None"; private const string SasValue = "SAS"; + private const string AccountKeyValue = "AccountKey"; private const string ServicePrincipalValue = "ServicePrincipal"; private const string AccessKeyValue = "AccessKey"; private const string ApiKeyValue = "ApiKey"; private const string CustomKeysValue = "CustomKeys"; + private const string OAuth2Value = "OAuth2"; + private const string AadValue = "AAD"; /// PAT. public static MachineLearningConnectionAuthType Pat { get; } = new MachineLearningConnectionAuthType(PatValue); @@ -42,6 +45,8 @@ public MachineLearningConnectionAuthType(string value) public static MachineLearningConnectionAuthType None { get; } = new MachineLearningConnectionAuthType(NoneValue); /// SAS. public static MachineLearningConnectionAuthType Sas { get; } = new MachineLearningConnectionAuthType(SasValue); + /// AccountKey. + public static MachineLearningConnectionAuthType AccountKey { get; } = new MachineLearningConnectionAuthType(AccountKeyValue); /// ServicePrincipal. public static MachineLearningConnectionAuthType ServicePrincipal { get; } = new MachineLearningConnectionAuthType(ServicePrincipalValue); /// AccessKey. @@ -50,6 +55,10 @@ public MachineLearningConnectionAuthType(string value) public static MachineLearningConnectionAuthType ApiKey { get; } = new MachineLearningConnectionAuthType(ApiKeyValue); /// CustomKeys. public static MachineLearningConnectionAuthType CustomKeys { get; } = new MachineLearningConnectionAuthType(CustomKeysValue); + /// OAuth2. + public static MachineLearningConnectionAuthType OAuth2 { get; } = new MachineLearningConnectionAuthType(OAuth2Value); + /// AAD. + public static MachineLearningConnectionAuthType Aad { get; } = new MachineLearningConnectionAuthType(AadValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningConnectionAuthType left, MachineLearningConnectionAuthType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs index 18a6d51812eb4..a6a4c9d98b7cc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs @@ -35,9 +35,95 @@ public MachineLearningConnectionCategory(string value) private const string RedisValue = "Redis"; private const string ApiKeyValue = "ApiKey"; private const string AzureOpenAIValue = "AzureOpenAI"; + private const string AIServicesValue = "AIServices"; private const string CognitiveSearchValue = "CognitiveSearch"; private const string CognitiveServiceValue = "CognitiveService"; private const string CustomKeysValue = "CustomKeys"; + private const string AzureBlobValue = "AzureBlob"; + private const string AzureOneLakeValue = "AzureOneLake"; + private const string CosmosDbValue = "CosmosDb"; + private const string CosmosDbMongoDbApiValue = "CosmosDbMongoDbApi"; + private const string AzureDataExplorerValue = "AzureDataExplorer"; + private const string AzureMariaDbValue = "AzureMariaDb"; + private const string AzureDatabricksDeltaLakeValue = "AzureDatabricksDeltaLake"; + private const string AzureSqlMiValue = "AzureSqlMi"; + private const string AzureTableStorageValue = "AzureTableStorage"; + private const string AmazonRdsForOracleValue = "AmazonRdsForOracle"; + private const string AmazonRdsForSqlServerValue = "AmazonRdsForSqlServer"; + private const string AmazonRedshiftValue = "AmazonRedshift"; + private const string Db2Value = "Db2"; + private const string DrillValue = "Drill"; + private const string GoogleBigQueryValue = "GoogleBigQuery"; + private const string GreenplumValue = "Greenplum"; + private const string HbaseValue = "Hbase"; + private const string HiveValue = "Hive"; + private const string ImpalaValue = "Impala"; + private const string InformixValue = "Informix"; + private const string MariaDbValue = "MariaDb"; + private const string MicrosoftAccessValue = "MicrosoftAccess"; + private const string MySqlValue = "MySql"; + private const string NetezzaValue = "Netezza"; + private const string OracleValue = "Oracle"; + private const string PhoenixValue = "Phoenix"; + private const string PostgreSqlValue = "PostgreSql"; + private const string PrestoValue = "Presto"; + private const string SapOpenHubValue = "SapOpenHub"; + private const string SapBwValue = "SapBw"; + private const string SapHanaValue = "SapHana"; + private const string SapTableValue = "SapTable"; + private const string SparkValue = "Spark"; + private const string SqlServerValue = "SqlServer"; + private const string SybaseValue = "Sybase"; + private const string TeradataValue = "Teradata"; + private const string VerticaValue = "Vertica"; + private const string CassandraValue = "Cassandra"; + private const string CouchbaseValue = "Couchbase"; + private const string MongoDbV2Value = "MongoDbV2"; + private const string MongoDbAtlasValue = "MongoDbAtlas"; + private const string AmazonS3CompatibleValue = "AmazonS3Compatible"; + private const string FileServerValue = "FileServer"; + private const string FtpServerValue = "FtpServer"; + private const string GoogleCloudStorageValue = "GoogleCloudStorage"; + private const string HdfsValue = "Hdfs"; + private const string OracleCloudStorageValue = "OracleCloudStorage"; + private const string SftpValue = "Sftp"; + private const string GenericHttpValue = "GenericHttp"; + private const string ODataRestValue = "ODataRest"; + private const string OdbcValue = "Odbc"; + private const string GenericRestValue = "GenericRest"; + private const string AmazonMwsValue = "AmazonMws"; + private const string ConcurValue = "Concur"; + private const string DynamicsValue = "Dynamics"; + private const string DynamicsAxValue = "DynamicsAx"; + private const string DynamicsCrmValue = "DynamicsCrm"; + private const string GoogleAdWordsValue = "GoogleAdWords"; + private const string HubspotValue = "Hubspot"; + private const string JiraValue = "Jira"; + private const string MagentoValue = "Magento"; + private const string MarketoValue = "Marketo"; + private const string Office365Value = "Office365"; + private const string EloquaValue = "Eloqua"; + private const string ResponsysValue = "Responsys"; + private const string OracleServiceCloudValue = "OracleServiceCloud"; + private const string PayPalValue = "PayPal"; + private const string QuickBooksValue = "QuickBooks"; + private const string SalesforceValue = "Salesforce"; + private const string SalesforceServiceCloudValue = "SalesforceServiceCloud"; + private const string SalesforceMarketingCloudValue = "SalesforceMarketingCloud"; + private const string SapCloudForCustomerValue = "SapCloudForCustomer"; + private const string SapEccValue = "SapEcc"; + private const string ServiceNowValue = "ServiceNow"; + private const string SharePointOnlineListValue = "SharePointOnlineList"; + private const string ShopifyValue = "Shopify"; + private const string SquareValue = "Square"; + private const string WebTableValue = "WebTable"; + private const string XeroValue = "Xero"; + private const string ZohoValue = "Zoho"; + private const string GenericContainerRegistryValue = "GenericContainerRegistry"; + private const string OpenAIValue = "OpenAI"; + private const string SerpValue = "Serp"; + private const string BingLLMSearchValue = "BingLLMSearch"; + private const string ServerlessValue = "Serverless"; /// PythonFeed. public static MachineLearningConnectionCategory PythonFeed { get; } = new MachineLearningConnectionCategory(PythonFeedValue); @@ -65,12 +151,184 @@ public MachineLearningConnectionCategory(string value) public static MachineLearningConnectionCategory ApiKey { get; } = new MachineLearningConnectionCategory(ApiKeyValue); /// AzureOpenAI. public static MachineLearningConnectionCategory AzureOpenAI { get; } = new MachineLearningConnectionCategory(AzureOpenAIValue); + /// AIServices. + public static MachineLearningConnectionCategory AIServices { get; } = new MachineLearningConnectionCategory(AIServicesValue); /// CognitiveSearch. public static MachineLearningConnectionCategory CognitiveSearch { get; } = new MachineLearningConnectionCategory(CognitiveSearchValue); /// CognitiveService. public static MachineLearningConnectionCategory CognitiveService { get; } = new MachineLearningConnectionCategory(CognitiveServiceValue); /// CustomKeys. public static MachineLearningConnectionCategory CustomKeys { get; } = new MachineLearningConnectionCategory(CustomKeysValue); + /// AzureBlob. + public static MachineLearningConnectionCategory AzureBlob { get; } = new MachineLearningConnectionCategory(AzureBlobValue); + /// AzureOneLake. + public static MachineLearningConnectionCategory AzureOneLake { get; } = new MachineLearningConnectionCategory(AzureOneLakeValue); + /// CosmosDb. + public static MachineLearningConnectionCategory CosmosDb { get; } = new MachineLearningConnectionCategory(CosmosDbValue); + /// CosmosDbMongoDbApi. + public static MachineLearningConnectionCategory CosmosDbMongoDbApi { get; } = new MachineLearningConnectionCategory(CosmosDbMongoDbApiValue); + /// AzureDataExplorer. + public static MachineLearningConnectionCategory AzureDataExplorer { get; } = new MachineLearningConnectionCategory(AzureDataExplorerValue); + /// AzureMariaDb. + public static MachineLearningConnectionCategory AzureMariaDb { get; } = new MachineLearningConnectionCategory(AzureMariaDbValue); + /// AzureDatabricksDeltaLake. + public static MachineLearningConnectionCategory AzureDatabricksDeltaLake { get; } = new MachineLearningConnectionCategory(AzureDatabricksDeltaLakeValue); + /// AzureSqlMi. + public static MachineLearningConnectionCategory AzureSqlMi { get; } = new MachineLearningConnectionCategory(AzureSqlMiValue); + /// AzureTableStorage. + public static MachineLearningConnectionCategory AzureTableStorage { get; } = new MachineLearningConnectionCategory(AzureTableStorageValue); + /// AmazonRdsForOracle. + public static MachineLearningConnectionCategory AmazonRdsForOracle { get; } = new MachineLearningConnectionCategory(AmazonRdsForOracleValue); + /// AmazonRdsForSqlServer. + public static MachineLearningConnectionCategory AmazonRdsForSqlServer { get; } = new MachineLearningConnectionCategory(AmazonRdsForSqlServerValue); + /// AmazonRedshift. + public static MachineLearningConnectionCategory AmazonRedshift { get; } = new MachineLearningConnectionCategory(AmazonRedshiftValue); + /// Db2. + public static MachineLearningConnectionCategory Db2 { get; } = new MachineLearningConnectionCategory(Db2Value); + /// Drill. + public static MachineLearningConnectionCategory Drill { get; } = new MachineLearningConnectionCategory(DrillValue); + /// GoogleBigQuery. + public static MachineLearningConnectionCategory GoogleBigQuery { get; } = new MachineLearningConnectionCategory(GoogleBigQueryValue); + /// Greenplum. + public static MachineLearningConnectionCategory Greenplum { get; } = new MachineLearningConnectionCategory(GreenplumValue); + /// Hbase. + public static MachineLearningConnectionCategory Hbase { get; } = new MachineLearningConnectionCategory(HbaseValue); + /// Hive. + public static MachineLearningConnectionCategory Hive { get; } = new MachineLearningConnectionCategory(HiveValue); + /// Impala. + public static MachineLearningConnectionCategory Impala { get; } = new MachineLearningConnectionCategory(ImpalaValue); + /// Informix. + public static MachineLearningConnectionCategory Informix { get; } = new MachineLearningConnectionCategory(InformixValue); + /// MariaDb. + public static MachineLearningConnectionCategory MariaDb { get; } = new MachineLearningConnectionCategory(MariaDbValue); + /// MicrosoftAccess. + public static MachineLearningConnectionCategory MicrosoftAccess { get; } = new MachineLearningConnectionCategory(MicrosoftAccessValue); + /// MySql. + public static MachineLearningConnectionCategory MySql { get; } = new MachineLearningConnectionCategory(MySqlValue); + /// Netezza. + public static MachineLearningConnectionCategory Netezza { get; } = new MachineLearningConnectionCategory(NetezzaValue); + /// Oracle. + public static MachineLearningConnectionCategory Oracle { get; } = new MachineLearningConnectionCategory(OracleValue); + /// Phoenix. + public static MachineLearningConnectionCategory Phoenix { get; } = new MachineLearningConnectionCategory(PhoenixValue); + /// PostgreSql. + public static MachineLearningConnectionCategory PostgreSql { get; } = new MachineLearningConnectionCategory(PostgreSqlValue); + /// Presto. + public static MachineLearningConnectionCategory Presto { get; } = new MachineLearningConnectionCategory(PrestoValue); + /// SapOpenHub. + public static MachineLearningConnectionCategory SapOpenHub { get; } = new MachineLearningConnectionCategory(SapOpenHubValue); + /// SapBw. + public static MachineLearningConnectionCategory SapBw { get; } = new MachineLearningConnectionCategory(SapBwValue); + /// SapHana. + public static MachineLearningConnectionCategory SapHana { get; } = new MachineLearningConnectionCategory(SapHanaValue); + /// SapTable. + public static MachineLearningConnectionCategory SapTable { get; } = new MachineLearningConnectionCategory(SapTableValue); + /// Spark. + public static MachineLearningConnectionCategory Spark { get; } = new MachineLearningConnectionCategory(SparkValue); + /// SqlServer. + public static MachineLearningConnectionCategory SqlServer { get; } = new MachineLearningConnectionCategory(SqlServerValue); + /// Sybase. + public static MachineLearningConnectionCategory Sybase { get; } = new MachineLearningConnectionCategory(SybaseValue); + /// Teradata. + public static MachineLearningConnectionCategory Teradata { get; } = new MachineLearningConnectionCategory(TeradataValue); + /// Vertica. + public static MachineLearningConnectionCategory Vertica { get; } = new MachineLearningConnectionCategory(VerticaValue); + /// Cassandra. + public static MachineLearningConnectionCategory Cassandra { get; } = new MachineLearningConnectionCategory(CassandraValue); + /// Couchbase. + public static MachineLearningConnectionCategory Couchbase { get; } = new MachineLearningConnectionCategory(CouchbaseValue); + /// MongoDbV2. + public static MachineLearningConnectionCategory MongoDbV2 { get; } = new MachineLearningConnectionCategory(MongoDbV2Value); + /// MongoDbAtlas. + public static MachineLearningConnectionCategory MongoDbAtlas { get; } = new MachineLearningConnectionCategory(MongoDbAtlasValue); + /// AmazonS3Compatible. + public static MachineLearningConnectionCategory AmazonS3Compatible { get; } = new MachineLearningConnectionCategory(AmazonS3CompatibleValue); + /// FileServer. + public static MachineLearningConnectionCategory FileServer { get; } = new MachineLearningConnectionCategory(FileServerValue); + /// FtpServer. + public static MachineLearningConnectionCategory FtpServer { get; } = new MachineLearningConnectionCategory(FtpServerValue); + /// GoogleCloudStorage. + public static MachineLearningConnectionCategory GoogleCloudStorage { get; } = new MachineLearningConnectionCategory(GoogleCloudStorageValue); + /// Hdfs. + public static MachineLearningConnectionCategory Hdfs { get; } = new MachineLearningConnectionCategory(HdfsValue); + /// OracleCloudStorage. + public static MachineLearningConnectionCategory OracleCloudStorage { get; } = new MachineLearningConnectionCategory(OracleCloudStorageValue); + /// Sftp. + public static MachineLearningConnectionCategory Sftp { get; } = new MachineLearningConnectionCategory(SftpValue); + /// GenericHttp. + public static MachineLearningConnectionCategory GenericHttp { get; } = new MachineLearningConnectionCategory(GenericHttpValue); + /// ODataRest. + public static MachineLearningConnectionCategory ODataRest { get; } = new MachineLearningConnectionCategory(ODataRestValue); + /// Odbc. + public static MachineLearningConnectionCategory Odbc { get; } = new MachineLearningConnectionCategory(OdbcValue); + /// GenericRest. + public static MachineLearningConnectionCategory GenericRest { get; } = new MachineLearningConnectionCategory(GenericRestValue); + /// AmazonMws. + public static MachineLearningConnectionCategory AmazonMws { get; } = new MachineLearningConnectionCategory(AmazonMwsValue); + /// Concur. + public static MachineLearningConnectionCategory Concur { get; } = new MachineLearningConnectionCategory(ConcurValue); + /// Dynamics. + public static MachineLearningConnectionCategory Dynamics { get; } = new MachineLearningConnectionCategory(DynamicsValue); + /// DynamicsAx. + public static MachineLearningConnectionCategory DynamicsAx { get; } = new MachineLearningConnectionCategory(DynamicsAxValue); + /// DynamicsCrm. + public static MachineLearningConnectionCategory DynamicsCrm { get; } = new MachineLearningConnectionCategory(DynamicsCrmValue); + /// GoogleAdWords. + public static MachineLearningConnectionCategory GoogleAdWords { get; } = new MachineLearningConnectionCategory(GoogleAdWordsValue); + /// Hubspot. + public static MachineLearningConnectionCategory Hubspot { get; } = new MachineLearningConnectionCategory(HubspotValue); + /// Jira. + public static MachineLearningConnectionCategory Jira { get; } = new MachineLearningConnectionCategory(JiraValue); + /// Magento. + public static MachineLearningConnectionCategory Magento { get; } = new MachineLearningConnectionCategory(MagentoValue); + /// Marketo. + public static MachineLearningConnectionCategory Marketo { get; } = new MachineLearningConnectionCategory(MarketoValue); + /// Office365. + public static MachineLearningConnectionCategory Office365 { get; } = new MachineLearningConnectionCategory(Office365Value); + /// Eloqua. + public static MachineLearningConnectionCategory Eloqua { get; } = new MachineLearningConnectionCategory(EloquaValue); + /// Responsys. + public static MachineLearningConnectionCategory Responsys { get; } = new MachineLearningConnectionCategory(ResponsysValue); + /// OracleServiceCloud. + public static MachineLearningConnectionCategory OracleServiceCloud { get; } = new MachineLearningConnectionCategory(OracleServiceCloudValue); + /// PayPal. + public static MachineLearningConnectionCategory PayPal { get; } = new MachineLearningConnectionCategory(PayPalValue); + /// QuickBooks. + public static MachineLearningConnectionCategory QuickBooks { get; } = new MachineLearningConnectionCategory(QuickBooksValue); + /// Salesforce. + public static MachineLearningConnectionCategory Salesforce { get; } = new MachineLearningConnectionCategory(SalesforceValue); + /// SalesforceServiceCloud. + public static MachineLearningConnectionCategory SalesforceServiceCloud { get; } = new MachineLearningConnectionCategory(SalesforceServiceCloudValue); + /// SalesforceMarketingCloud. + public static MachineLearningConnectionCategory SalesforceMarketingCloud { get; } = new MachineLearningConnectionCategory(SalesforceMarketingCloudValue); + /// SapCloudForCustomer. + public static MachineLearningConnectionCategory SapCloudForCustomer { get; } = new MachineLearningConnectionCategory(SapCloudForCustomerValue); + /// SapEcc. + public static MachineLearningConnectionCategory SapEcc { get; } = new MachineLearningConnectionCategory(SapEccValue); + /// ServiceNow. + public static MachineLearningConnectionCategory ServiceNow { get; } = new MachineLearningConnectionCategory(ServiceNowValue); + /// SharePointOnlineList. + public static MachineLearningConnectionCategory SharePointOnlineList { get; } = new MachineLearningConnectionCategory(SharePointOnlineListValue); + /// Shopify. + public static MachineLearningConnectionCategory Shopify { get; } = new MachineLearningConnectionCategory(ShopifyValue); + /// Square. + public static MachineLearningConnectionCategory Square { get; } = new MachineLearningConnectionCategory(SquareValue); + /// WebTable. + public static MachineLearningConnectionCategory WebTable { get; } = new MachineLearningConnectionCategory(WebTableValue); + /// Xero. + public static MachineLearningConnectionCategory Xero { get; } = new MachineLearningConnectionCategory(XeroValue); + /// Zoho. + public static MachineLearningConnectionCategory Zoho { get; } = new MachineLearningConnectionCategory(ZohoValue); + /// GenericContainerRegistry. + public static MachineLearningConnectionCategory GenericContainerRegistry { get; } = new MachineLearningConnectionCategory(GenericContainerRegistryValue); + /// OpenAI. + public static MachineLearningConnectionCategory OpenAI { get; } = new MachineLearningConnectionCategory(OpenAIValue); + /// Serp. + public static MachineLearningConnectionCategory Serp { get; } = new MachineLearningConnectionCategory(SerpValue); + /// BingLLMSearch. + public static MachineLearningConnectionCategory BingLLMSearch { get; } = new MachineLearningConnectionCategory(BingLLMSearchValue); + /// Serverless. + public static MachineLearningConnectionCategory Serverless { get; } = new MachineLearningConnectionCategory(ServerlessValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningConnectionCategory left, MachineLearningConnectionCategory right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs index 8f3a47b422397..028596deae7a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningContainerType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// The type of container to retrieve logs from. + /// The MachineLearningContainerType. public readonly partial struct MachineLearningContainerType : IEquatable { private readonly string _value; @@ -24,14 +24,11 @@ public MachineLearningContainerType(string value) private const string StorageInitializerValue = "StorageInitializer"; private const string InferenceServerValue = "InferenceServer"; - private const string ModelDataCollectorValue = "ModelDataCollector"; - /// The container used to download models and score script. + /// StorageInitializer. public static MachineLearningContainerType StorageInitializer { get; } = new MachineLearningContainerType(StorageInitializerValue); - /// The container used to serve user's request. + /// InferenceServer. public static MachineLearningContainerType InferenceServer { get; } = new MachineLearningContainerType(InferenceServerValue); - /// The container used to collect payload and custom logging when mdc is enabled. - public static MachineLearningContainerType ModelDataCollector { get; } = new MachineLearningContainerType(ModelDataCollectorValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningContainerType left, MachineLearningContainerType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs index 24ec330c8bbb5..b0b2ac9b9cc53 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningCustomModelJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningCustomModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs index 710b27d781b84..bf1acd9708591 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningCustomModelJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningCustomModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningCustomModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs deleted file mode 100644 index 0715d44f6be6a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionCollectionGetAllOptions.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MachineLearningDataVersionCollectionGetAllOptions. - public partial class MachineLearningDataVersionCollectionGetAllOptions - { - /// Initializes a new instance of . - public MachineLearningDataVersionCollectionGetAllOptions() - { - } - - /// Please choose OrderBy value from ['createdtime', 'modifiedtime']. - public string OrderBy { get; set; } - /// - /// Top count of results, top count cannot be greater than the page size. - /// If topCount > page size, results with be default page size count will be returned - /// - public int? Top { get; set; } - /// Continuation token for pagination. - public string Skip { get; set; } - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - public string Tags { get; set; } - /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - public MachineLearningListViewType? ListViewType { get; set; } - /// data stage. - public string Stage { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs index 89c2af93c4208..8cfea4d8cd9ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs @@ -29,42 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs index 54cdebbaa3d27..ffe2daef51187 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs @@ -32,19 +32,14 @@ public MachineLearningDataVersionProperties(Uri dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal MachineLearningDataVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningDataVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { DataType = dataType; DataUri = dataUri; - IntellectualProperty = intellectualProperty; - Stage = stage; } /// Initializes a new instance of for deserialization. @@ -56,9 +51,5 @@ internal MachineLearningDataVersionProperties() internal MachineLearningDataType DataType { get; set; } /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. public Uri DataUri { get; set; } - /// Intellectual Property details. Used if data is an Intellectual Property. - public IntellectualProperty IntellectualProperty { get; set; } - /// Stage in the data lifecycle assigned to this data asset. - public string Stage { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs index e1f570248619a..b697af2b272f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.Serialization.cs @@ -72,8 +72,6 @@ internal static MachineLearningDatastoreCredentials DeserializeMachineLearningDa { case "AccountKey": return MachineLearningAccountKeyDatastoreCredentials.DeserializeMachineLearningAccountKeyDatastoreCredentials(element, options); case "Certificate": return MachineLearningCertificateDatastoreCredentials.DeserializeMachineLearningCertificateDatastoreCredentials(element, options); - case "KerberosKeytab": return KerberosKeytabCredentials.DeserializeKerberosKeytabCredentials(element, options); - case "KerberosPassword": return KerberosPasswordCredentials.DeserializeKerberosPasswordCredentials(element, options); case "None": return MachineLearningNoneDatastoreCredentials.DeserializeMachineLearningNoneDatastoreCredentials(element, options); case "Sas": return MachineLearningSasDatastoreCredentials.DeserializeMachineLearningSasDatastoreCredentials(element, options); case "ServicePrincipal": return MachineLearningServicePrincipalDatastoreCredentials.DeserializeMachineLearningServicePrincipalDatastoreCredentials(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs index 24d3e64602879..a77606d77bd0b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreCredentials.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for datastore credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// public abstract partial class MachineLearningDatastoreCredentials { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs index e6a03218e6575..567ea3d6b9796 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.Serialization.cs @@ -29,18 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -140,7 +128,6 @@ internal static MachineLearningDatastoreProperties DeserializeMachineLearningDat case "AzureDataLakeGen1": return MachineLearningAzureDataLakeGen1Datastore.DeserializeMachineLearningAzureDataLakeGen1Datastore(element, options); case "AzureDataLakeGen2": return MachineLearningAzureDataLakeGen2Datastore.DeserializeMachineLearningAzureDataLakeGen2Datastore(element, options); case "AzureFile": return MachineLearningAzureFileDatastore.DeserializeMachineLearningAzureFileDatastore(element, options); - case "Hdfs": return HdfsDatastore.DeserializeHdfsDatastore(element, options); case "OneLake": return OneLakeDatastore.DeserializeOneLakeDatastore(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs index a50e972ec1b4f..67d0116fa621d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for datastore contents configuration. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , and . /// public partial class MachineLearningDatastoreProperties : MachineLearningResourceBase { @@ -21,7 +21,7 @@ public partial class MachineLearningDatastoreProperties : MachineLearningResourc /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// is null. public MachineLearningDatastoreProperties(MachineLearningDatastoreCredentials credentials) @@ -39,16 +39,14 @@ public MachineLearningDatastoreProperties(MachineLearningDatastoreCredentials cr /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. - internal MachineLearningDatastoreProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData) + internal MachineLearningDatastoreProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData) { Credentials = credentials; DatastoreType = datastoreType; - IntellectualProperty = intellectualProperty; IsDefault = isDefault; } @@ -60,13 +58,11 @@ internal MachineLearningDatastoreProperties() /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// public MachineLearningDatastoreCredentials Credentials { get; set; } /// [Required] Storage type backing the datastore. internal DatastoreType DatastoreType { get; set; } - /// Intellectual Property details. - public IntellectualProperty IntellectualProperty { get; set; } /// Readonly property to indicate if datastore is the workspace default datastore. public bool? IsDefault { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs index 87c78e848ea05..53b108133ad2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.Serialization.cs @@ -72,8 +72,6 @@ internal static MachineLearningDatastoreSecrets DeserializeMachineLearningDatast { case "AccountKey": return MachineLearningAccountKeyDatastoreSecrets.DeserializeMachineLearningAccountKeyDatastoreSecrets(element, options); case "Certificate": return MachineLearningCertificateDatastoreSecrets.DeserializeMachineLearningCertificateDatastoreSecrets(element, options); - case "KerberosKeytab": return KerberosKeytabSecrets.DeserializeKerberosKeytabSecrets(element, options); - case "KerberosPassword": return KerberosPasswordSecrets.DeserializeKerberosPasswordSecrets(element, options); case "Sas": return MachineLearningSasDatastoreSecrets.DeserializeMachineLearningSasDatastoreSecrets(element, options); case "ServicePrincipal": return MachineLearningServicePrincipalDatastoreSecrets.DeserializeMachineLearningServicePrincipalDatastoreSecrets(element, options); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs index eeb7c7176b8bb..fc0fee9615bf3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreSecrets.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for datastore secrets. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , and . /// public abstract partial class MachineLearningDatastoreSecrets { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs index 4cbb10c1ac64a..118568a8bb349 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.Serialization.cs @@ -43,35 +43,6 @@ void IJsonModel.Write(Utf8JsonWr writer.WriteNull("instanceType"); } } - if (Optional.IsCollectionDefined(Locations)) - { - if (Locations != null) - { - writer.WritePropertyName("locations"u8); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("locations"); - } - } - if (Optional.IsDefined(MaxInstanceCount)) - { - if (MaxInstanceCount != null) - { - writer.WritePropertyName("maxInstanceCount"u8); - writer.WriteNumberValue(MaxInstanceCount.Value); - } - else - { - writer.WriteNull("maxInstanceCount"); - } - } if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -142,8 +113,6 @@ internal static MachineLearningDeploymentResourceConfiguration DeserializeMachin } int? instanceCount = default; string instanceType = default; - IList locations = default; - int? maxInstanceCount = default; IDictionary properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -168,31 +137,6 @@ internal static MachineLearningDeploymentResourceConfiguration DeserializeMachin instanceType = property.Value.GetString(); continue; } - if (property.NameEquals("locations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - locations = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("maxInstanceCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxInstanceCount = null; - continue; - } - maxInstanceCount = property.Value.GetInt32(); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,13 +165,7 @@ internal static MachineLearningDeploymentResourceConfiguration DeserializeMachin } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningDeploymentResourceConfiguration( - instanceCount, - instanceType, - locations ?? new ChangeTrackingList(), - maxInstanceCount, - properties ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData); + return new MachineLearningDeploymentResourceConfiguration(instanceCount, instanceType, properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs index 33a4c554684e0..eff355ebbf46a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDeploymentResourceConfiguration.cs @@ -21,14 +21,9 @@ public MachineLearningDeploymentResourceConfiguration() /// Initializes a new instance of . /// Optional number of instances or nodes used by the compute target. /// Optional type of VM used as supported by the compute target. - /// Locations where the job can run. - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// /// Additional properties bag. /// Keeps track of any properties unknown to the library. - internal MachineLearningDeploymentResourceConfiguration(int? instanceCount, string instanceType, IList locations, int? maxInstanceCount, IDictionary properties, IDictionary serializedAdditionalRawData) : base(instanceCount, instanceType, locations, maxInstanceCount, properties, serializedAdditionalRawData) + internal MachineLearningDeploymentResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData) : base(instanceCount, instanceType, properties, serializedAdditionalRawData) { } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs index 4da54ec71e0d4..b3978e4194f55 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.Serialization.cs @@ -72,7 +72,6 @@ internal static MachineLearningDistributionConfiguration DeserializeMachineLearn { case "Mpi": return MpiDistributionConfiguration.DeserializeMpiDistributionConfiguration(element, options); case "PyTorch": return PyTorchDistributionConfiguration.DeserializePyTorchDistributionConfiguration(element, options); - case "Ray": return RayDistributionConfiguration.DeserializeRayDistributionConfiguration(element, options); case "TensorFlow": return TensorFlowDistributionConfiguration.DeserializeTensorFlowDistributionConfiguration(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs index 5f1f7f74601e9..3f416bcebe248 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDistributionConfiguration.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for job distribution configuration. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public abstract partial class MachineLearningDistributionConfiguration { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs index 991b167ed89a5..53c99c436c6a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs @@ -55,7 +55,7 @@ public MachineLearningEndpointDeploymentProperties() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. @@ -73,7 +73,7 @@ internal MachineLearningEndpointDeploymentProperties(MachineLearningCodeConfigur public MachineLearningCodeConfiguration CodeConfiguration { get; set; } /// Description of the endpoint deployment. public string Description { get; set; } - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. public string EnvironmentId { get; set; } /// Environment variables configuration for the deployment. public IDictionary EnvironmentVariables { get; set; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs index f752a3ce4353b..672bbfa2881ca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs @@ -56,18 +56,6 @@ void IJsonModel.Write(Utf8JsonWrite writer.WritePropertyName("inferenceConfig"u8); writer.WriteObjectValue(InferenceConfig, options); } - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (Optional.IsDefined(OSType)) { writer.WritePropertyName("osType"u8); @@ -90,18 +78,6 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -204,11 +180,9 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe MachineLearningEnvironmentType? environmentType = default; string image = default; MachineLearningInferenceContainerProperties inferenceConfig = default; - IntellectualProperty intellectualProperty = default; MachineLearningOperatingSystemType? osType = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -264,16 +238,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe inferenceConfig = MachineLearningInferenceContainerProperties.DeserializeMachineLearningInferenceContainerProperties(property.Value, options); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("osType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -302,16 +266,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -381,7 +335,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, autoRebuild, @@ -390,7 +343,6 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe environmentType, image, inferenceConfig, - intellectualProperty, osType, provisioningState, stage); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs index f5f685315463d..cc1bf15317843 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs @@ -23,9 +23,8 @@ public MachineLearningEnvironmentVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Defines if image needs to be rebuilt based on base image changes. /// Configuration settings for Docker build context. /// @@ -41,11 +40,10 @@ public MachineLearningEnvironmentVersionProperties() /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// /// Defines configuration specific to inference. - /// Intellectual Property details. Used if environment is an Intellectual Property. /// The OS type of the environment. /// Provisioning state for the environment version. /// Stage in the environment lifecycle assigned to this environment. - internal MachineLearningEnvironmentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, AutoRebuildSetting? autoRebuild, MachineLearningBuildContext build, string condaFile, MachineLearningEnvironmentType? environmentType, string image, MachineLearningInferenceContainerProperties inferenceConfig, IntellectualProperty intellectualProperty, MachineLearningOperatingSystemType? osType, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningEnvironmentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, AutoRebuildSetting? autoRebuild, MachineLearningBuildContext build, string condaFile, MachineLearningEnvironmentType? environmentType, string image, MachineLearningInferenceContainerProperties inferenceConfig, MachineLearningOperatingSystemType? osType, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { AutoRebuild = autoRebuild; Build = build; @@ -53,7 +51,6 @@ internal MachineLearningEnvironmentVersionProperties(string description, IDictio EnvironmentType = environmentType; Image = image; InferenceConfig = inferenceConfig; - IntellectualProperty = intellectualProperty; OSType = osType; ProvisioningState = provisioningState; Stage = stage; @@ -80,8 +77,6 @@ internal MachineLearningEnvironmentVersionProperties(string description, IDictio public string Image { get; set; } /// Defines configuration specific to inference. public MachineLearningInferenceContainerProperties InferenceConfig { get; set; } - /// Intellectual Property details. Used if environment is an Intellectual Property. - public IntellectualProperty IntellectualProperty { get; set; } /// The OS type of the environment. public MachineLearningOperatingSystemType? OSType { get; set; } /// Provisioning state for the environment version. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs new file mode 100644 index 0000000000000..ab556b942aa77 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureCollectionGetAllOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MachineLearningFeatureCollectionGetAllOptions. + public partial class MachineLearningFeatureCollectionGetAllOptions + { + /// Initializes a new instance of . + public MachineLearningFeatureCollectionGetAllOptions() + { + } + + /// Continuation token for pagination. + public string Skip { get; set; } + /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + public string Tags { get; set; } + /// feature name. + public string FeatureName { get; set; } + /// Description of the featureset. + public string Description { get; set; } + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + public MachineLearningListViewType? ListViewType { get; set; } + /// Page size. + public int? PageSize { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs index 67ec9d99fb000..a47817a64cc6d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature. + /// DTO object representing feature. public partial class MachineLearningFeatureProperties : MachineLearningResourceBase { /// Initializes a new instance of . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs index 5af962d899f26..ee9c052ea4ecb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetContainerProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature set. + /// DTO object representing feature set. public partial class MachineLearningFeatureSetContainerProperties : MachineLearningAssetContainer { /// Initializes a new instance of . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs deleted file mode 100644 index 66644ca8c4162..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.Serialization.cs +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class MachineLearningFeatureSetJob : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(CreatedOn)) - { - if (CreatedOn != null) - { - writer.WritePropertyName("createdDate"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - else - { - writer.WriteNull("createdDate"); - } - } - if (Optional.IsDefined(DisplayName)) - { - if (DisplayName != null) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - else - { - writer.WriteNull("displayName"); - } - } - if (Optional.IsDefined(Duration)) - { - if (Duration != null) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "P"); - } - else - { - writer.WriteNull("duration"); - } - } - if (Optional.IsDefined(ExperimentId)) - { - if (ExperimentId != null) - { - writer.WritePropertyName("experimentId"u8); - writer.WriteStringValue(ExperimentId); - } - else - { - writer.WriteNull("experimentId"); - } - } - if (Optional.IsDefined(FeatureWindow)) - { - if (FeatureWindow != null) - { - writer.WritePropertyName("featureWindow"u8); - writer.WriteObjectValue(FeatureWindow, options); - } - else - { - writer.WriteNull("featureWindow"); - } - } - if (Optional.IsDefined(JobId)) - { - if (JobId != null) - { - writer.WritePropertyName("jobId"u8); - writer.WriteStringValue(JobId); - } - else - { - writer.WriteNull("jobId"); - } - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (Optional.IsDefined(FeatureStoreJobType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(FeatureStoreJobType.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MachineLearningFeatureSetJob IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningFeatureSetJob(document.RootElement, options); - } - - internal static MachineLearningFeatureSetJob DeserializeMachineLearningFeatureSetJob(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset? createdDate = default; - string displayName = default; - TimeSpan? duration = default; - string experimentId = default; - FeatureWindow featureWindow = default; - string jobId = default; - MachineLearningJobStatus? status = default; - IReadOnlyDictionary tags = default; - FeatureStoreJobType? type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("createdDate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - createdDate = null; - continue; - } - createdDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("displayName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - displayName = null; - continue; - } - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("duration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - duration = null; - continue; - } - duration = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("experimentId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - experimentId = null; - continue; - } - experimentId = property.Value.GetString(); - continue; - } - if (property.NameEquals("featureWindow"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - featureWindow = null; - continue; - } - featureWindow = FeatureWindow.DeserializeFeatureWindow(property.Value, options); - continue; - } - if (property.NameEquals("jobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - jobId = null; - continue; - } - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new MachineLearningJobStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new FeatureStoreJobType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningFeatureSetJob( - createdDate, - displayName, - duration, - experimentId, - featureWindow, - jobId, - status, - tags ?? new ChangeTrackingDictionary(), - type, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support writing '{options.Format}' format."); - } - } - - MachineLearningFeatureSetJob IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningFeatureSetJob(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineLearningFeatureSetJob)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs deleted file mode 100644 index e7c2d75728b68..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetJob.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Dto object representing the feature set job. - public partial class MachineLearningFeatureSetJob - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MachineLearningFeatureSetJob() - { - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Specifies the created date. - /// Specifies the display name. - /// Specifies the duration. - /// Specifies the experiment id. - /// Specifies the backfill feature window to be materialized. - /// Specifies the job id. - /// Specifies the job status. - /// Specifies the tags if any. - /// Specifies the feature store job type. - /// Keeps track of any properties unknown to the library. - internal MachineLearningFeatureSetJob(DateTimeOffset? createdOn, string displayName, TimeSpan? duration, string experimentId, FeatureWindow featureWindow, string jobId, MachineLearningJobStatus? status, IReadOnlyDictionary tags, FeatureStoreJobType? featureStoreJobType, IDictionary serializedAdditionalRawData) - { - CreatedOn = createdOn; - DisplayName = displayName; - Duration = duration; - ExperimentId = experimentId; - FeatureWindow = featureWindow; - JobId = jobId; - Status = status; - Tags = tags; - FeatureStoreJobType = featureStoreJobType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies the created date. - public DateTimeOffset? CreatedOn { get; } - /// Specifies the display name. - public string DisplayName { get; } - /// Specifies the duration. - public TimeSpan? Duration { get; } - /// Specifies the experiment id. - public string ExperimentId { get; } - /// Specifies the backfill feature window to be materialized. - public FeatureWindow FeatureWindow { get; } - /// Specifies the job id. - public string JobId { get; } - /// Specifies the job status. - public MachineLearningJobStatus? Status { get; } - /// Specifies the tags if any. - public IReadOnlyDictionary Tags { get; } - /// Specifies the feature store job type. - public FeatureStoreJobType? FeatureStoreJobType { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs index 24a04b011abc1..2e2f27be13ec6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs @@ -84,18 +84,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -197,7 +185,6 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea RegistryAssetProvisioningState? provisioningState = default; FeaturesetSpecification specification = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -261,16 +248,6 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -340,7 +317,6 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, entities ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs index d7bbffe138c3d..304743ac12aed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature set version. + /// DTO object representing feature set version. public partial class MachineLearningFeatureSetVersionProperties : MachineLearningAssetBase { /// Initializes a new instance of . @@ -24,15 +24,14 @@ public MachineLearningFeatureSetVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies list of entities. /// Specifies the materialization settings. /// Provisioning state for the featureset version container. /// Specifies the feature spec details. /// Specifies the asset stage. - internal MachineLearningFeatureSetVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, IList entities, MaterializationSettings materializationSettings, RegistryAssetProvisioningState? provisioningState, FeaturesetSpecification specification, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningFeatureSetVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IList entities, MaterializationSettings materializationSettings, RegistryAssetProvisioningState? provisioningState, FeaturesetSpecification specification, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { Entities = entities; MaterializationSettings = materializationSettings; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs index 8a633db24f2ec..d92241cbf8852 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityContainerProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature entity. + /// DTO object representing feature entity. public partial class MachineLearningFeatureStoreEntityContainerProperties : MachineLearningAssetContainer { /// Initializes a new instance of . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs index c796d682de7bc..9c9715910c7cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs @@ -60,18 +60,6 @@ void IJsonModel.Write(Utf8Js writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -171,7 +159,6 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa IList indexColumns = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -215,16 +202,6 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -294,7 +271,6 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, indexColumns ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs index 78dcda52b67e8..afd396d737a0c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing feature entity version. + /// DTO object representing feature entity version. public partial class MachineLearningFeatureStoreEntityVersionProperties : MachineLearningAssetBase { /// Initializes a new instance of . @@ -24,13 +24,12 @@ public MachineLearningFeatureStoreEntityVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies index columns. /// Provisioning state for the featurestore entity version. /// Specifies the asset stage. - internal MachineLearningFeatureStoreEntityVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, IList indexColumns, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningFeatureStoreEntityVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IList indexColumns, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { IndexColumns = indexColumns; ProvisioningState = provisioningState; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs deleted file mode 100644 index 8140672b79bd7..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowAutoLoggerState.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum to determine the state of mlflow autologger. - public readonly partial struct MachineLearningFlowAutoLoggerState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MachineLearningFlowAutoLoggerState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static MachineLearningFlowAutoLoggerState Enabled { get; } = new MachineLearningFlowAutoLoggerState(EnabledValue); - /// Disabled. - public static MachineLearningFlowAutoLoggerState Disabled { get; } = new MachineLearningFlowAutoLoggerState(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(MachineLearningFlowAutoLoggerState left, MachineLearningFlowAutoLoggerState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MachineLearningFlowAutoLoggerState left, MachineLearningFlowAutoLoggerState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MachineLearningFlowAutoLoggerState(string value) => new MachineLearningFlowAutoLoggerState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MachineLearningFlowAutoLoggerState other && Equals(other); - /// - public bool Equals(MachineLearningFlowAutoLoggerState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs index c8db2b4b4580a..e6204bcdacb38 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningFlowModelJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningFlowModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs index eff40fd148149..b18089ed79179 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningFlowModelJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningFlowModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningFlowModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs index eed54896bbdbb..6af5eaf4ad9b6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs @@ -84,18 +84,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -120,35 +108,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("nCrossValidations"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(TestData)) { if (TestData != null) @@ -273,11 +232,8 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting ForecastingTrainingSettings trainingSettings = default; IList cvSplitColumnNames = default; TableVerticalFeaturizationSettings featurizationSettings = default; - TableFixedParameters fixedParameters = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; - IList searchSpace = default; - TableSweepSettings sweepSettings = default; MachineLearningTableJobInput testData = default; double? testDataSize = default; MachineLearningTableJobInput validationData = default; @@ -345,16 +301,6 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = TableFixedParameters.DeserializeTableFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -375,31 +321,6 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TableParameterSubspace.DeserializeTableParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = TableSweepSettings.DeserializeTableSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("testData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -496,11 +417,8 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting trainingSettings, cvSplitColumnNames ?? new ChangeTrackingList(), featurizationSettings, - fixedParameters, limitSettings, nCrossValidations, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, testData, testDataSize, validationData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs index b6fe288c1ed77..0cafad244c9f0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs @@ -21,7 +21,6 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b Argument.AssertNotNull(trainingData, nameof(trainingData)); CvSplitColumnNames = new ChangeTrackingList(); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.Forecasting; } @@ -39,7 +38,6 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Inputs for training phase for an AutoML Job. /// Columns to use for CVSplit data. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -47,8 +45,6 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Test data input. /// /// The fraction of test dataset that needs to be set aside for validation purpose. @@ -62,18 +58,15 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Applied when validation dataset is not provided. /// /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. - internal MachineLearningForecasting(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ForecastingSettings forecastingSettings, ForecastingPrimaryMetric? primaryMetric, ForecastingTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableFixedParameters fixedParameters, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList searchSpace, TableSweepSettings sweepSettings, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal MachineLearningForecasting(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ForecastingSettings forecastingSettings, ForecastingPrimaryMetric? primaryMetric, ForecastingTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { ForecastingSettings = forecastingSettings; PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; CvSplitColumnNames = cvSplitColumnNames; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; TestData = testData; TestDataSize = testDataSize; ValidationData = validationData; @@ -97,8 +90,6 @@ internal MachineLearningForecasting() public IList CvSplitColumnNames { get; set; } /// Featurization inputs needed for AutoML job. public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } - /// Model/training parameters that will remain constant throughout training. - public TableFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -108,10 +99,6 @@ internal MachineLearningForecasting() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public TableSweepSettings SweepSettings { get; set; } /// Test data input. public MachineLearningTableJobInput TestData { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs deleted file mode 100644 index 14c23f5f2f3af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobCollectionGetAllOptions.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MachineLearningJobCollectionGetAllOptions. - public partial class MachineLearningJobCollectionGetAllOptions - { - /// Initializes a new instance of . - public MachineLearningJobCollectionGetAllOptions() - { - } - - /// Continuation token for pagination. - public string Skip { get; set; } - /// Type of job to be returned. - public string JobType { get; set; } - /// Jobs returned will have this tag key. - public string Tag { get; set; } - /// View type for including/excluding (for example) archived entities. - public MachineLearningListViewType? ListViewType { get; set; } - /// Asset name the job's named output is registered with. - public string AssetName { get; set; } - /// Indicator whether the job is scheduled job. - public bool? Scheduled { get; set; } - /// The scheduled id for listing the job triggered from. - public string ScheduleId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs index 3eee51ac52048..2113e2c45b397 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs @@ -97,24 +97,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -230,7 +212,7 @@ internal static MachineLearningJobProperties DeserializeMachineLearningJobProper { case "AutoML": return AutoMLJob.DeserializeAutoMLJob(element, options); case "Command": return MachineLearningCommandJob.DeserializeMachineLearningCommandJob(element, options); - case "Labeling": return LabelingJobProperties.DeserializeLabelingJobProperties(element, options); + case "FineTuning": return FineTuningJob.DeserializeFineTuningJob(element, options); case "Pipeline": return MachineLearningPipelineJob.DeserializeMachineLearningPipelineJob(element, options); case "Spark": return SparkJob.DeserializeSparkJob(element, options); case "Sweep": return MachineLearningSweepJob.DeserializeMachineLearningSweepJob(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs index c598cdb9be9fa..9efd9ba16b9bd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs @@ -14,14 +14,13 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for a job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// public partial class MachineLearningJobProperties : MachineLearningResourceBase { /// Initializes a new instance of . public MachineLearningJobProperties() { - SecretsConfiguration = new ChangeTrackingDictionary(); Services = new ChangeTrackingDictionary(); } @@ -43,13 +42,12 @@ public MachineLearningJobProperties() /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - internal MachineLearningJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData) + internal MachineLearningJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData) { ComponentId = componentId; ComputeId = computeId; @@ -59,7 +57,6 @@ internal MachineLearningJobProperties(string description, IDictionary Notification setting for the job. public NotificationSetting NotificationSetting { get; set; } - /// Configuration for secrets to be made available during runtime. - public IDictionary SecretsConfiguration { get; set; } /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs index 17be76a8c3b2a..7566763378f8b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.Serialization.cs @@ -60,35 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteNull("instanceType"); } } - if (Optional.IsCollectionDefined(Locations)) - { - if (Locations != null) - { - writer.WritePropertyName("locations"u8); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("locations"); - } - } - if (Optional.IsDefined(MaxInstanceCount)) - { - if (MaxInstanceCount != null) - { - writer.WritePropertyName("maxInstanceCount"u8); - writer.WriteNumberValue(MaxInstanceCount.Value); - } - else - { - writer.WriteNull("maxInstanceCount"); - } - } if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -161,8 +132,6 @@ internal static MachineLearningJobResourceConfiguration DeserializeMachineLearni string shmSize = default; int? instanceCount = default; string instanceType = default; - IList locations = default; - int? maxInstanceCount = default; IDictionary properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -202,31 +171,6 @@ internal static MachineLearningJobResourceConfiguration DeserializeMachineLearni instanceType = property.Value.GetString(); continue; } - if (property.NameEquals("locations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - locations = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("maxInstanceCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxInstanceCount = null; - continue; - } - maxInstanceCount = property.Value.GetInt32(); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -258,8 +202,6 @@ internal static MachineLearningJobResourceConfiguration DeserializeMachineLearni return new MachineLearningJobResourceConfiguration( instanceCount, instanceType, - locations ?? new ChangeTrackingList(), - maxInstanceCount, properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, dockerArgs, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs index ab1f7d5009b1b..b2950c85222d2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs @@ -21,16 +21,11 @@ public MachineLearningJobResourceConfiguration() /// Initializes a new instance of . /// Optional number of instances or nodes used by the compute target. /// Optional type of VM used as supported by the compute target. - /// Locations where the job can run. - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// /// Additional properties bag. /// Keeps track of any properties unknown to the library. /// Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types. /// Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). - internal MachineLearningJobResourceConfiguration(int? instanceCount, string instanceType, IList locations, int? maxInstanceCount, IDictionary properties, IDictionary serializedAdditionalRawData, string dockerArgs, string shmSize) : base(instanceCount, instanceType, locations, maxInstanceCount, properties, serializedAdditionalRawData) + internal MachineLearningJobResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData, string dockerArgs, string shmSize) : base(instanceCount, instanceType, properties, serializedAdditionalRawData) { DockerArgs = dockerArgs; ShmSize = shmSize; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs index 202108f01316e..23b52b9e0b7bb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs @@ -17,7 +17,7 @@ public partial class MachineLearningJobScheduleAction : MachineLearningScheduleA /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// /// is null. public MachineLearningJobScheduleAction(MachineLearningJobProperties jobDefinition) @@ -34,7 +34,7 @@ public MachineLearningJobScheduleAction(MachineLearningJobProperties jobDefiniti /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// internal MachineLearningJobScheduleAction(ScheduleActionType actionType, IDictionary serializedAdditionalRawData, MachineLearningJobProperties jobDefinition) : base(actionType, serializedAdditionalRawData) { @@ -50,7 +50,7 @@ internal MachineLearningJobScheduleAction() /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// The available derived classes include , , , , and . /// public MachineLearningJobProperties JobDefinition { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs index ca8739d0ee426..e660e21a4c973 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs @@ -61,7 +61,7 @@ public MachineLearningJobService() /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - /// Port for endpoint set by user. + /// Port for endpoint. /// Additional properties to set on the endpoint. /// Status of endpoint. /// Keeps track of any properties unknown to the library. @@ -90,7 +90,7 @@ internal MachineLearningJobService(string endpoint, string errorMessage, string /// The available derived classes include . /// public JobNodes Nodes { get; set; } - /// Port for endpoint set by user. + /// Port for endpoint. public int? Port { get; set; } /// Additional properties to set on the endpoint. public IDictionary Properties { get; set; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs index 5413431a9ec78..e7551d29e477b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobStatus.cs @@ -36,7 +36,6 @@ public MachineLearningJobStatus(string value) private const string NotRespondingValue = "NotResponding"; private const string PausedValue = "Paused"; private const string UnknownValue = "Unknown"; - private const string ScheduledValue = "Scheduled"; /// Run hasn't started yet. public static MachineLearningJobStatus NotStarted { get; } = new MachineLearningJobStatus(NotStartedValue); @@ -69,8 +68,6 @@ public MachineLearningJobStatus(string value) public static MachineLearningJobStatus Paused { get; } = new MachineLearningJobStatus(PausedValue); /// Default job status if not mapped to all other statuses. public static MachineLearningJobStatus Unknown { get; } = new MachineLearningJobStatus(UnknownValue); - /// The job is in a scheduled state. Job is not in any active state. - public static MachineLearningJobStatus Scheduled { get; } = new MachineLearningJobStatus(ScheduledValue); /// Determines if two values are the same. public static bool operator ==(MachineLearningJobStatus left, MachineLearningJobStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs index 3d457bf19cf1d..93a21987e419b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs @@ -22,7 +22,7 @@ public MachineLearningKubernetesOnlineDeployment() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs index bb273ea5eca69..b0e178253d690 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri MachineLearningWorkspaceConnectionManagedIdentity credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri return new MachineLearningManagedIdentityAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs index dc051ac8173fd..62d1b92848ce5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningManagedIdentityAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionManagedIdentity credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionManagedIdentity credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs index 84641c44d7b30..b9dc436df61e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs @@ -22,7 +22,7 @@ public MachineLearningManagedOnlineDeployment() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs index bf3ae74f31770..3934efc9ae937 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionCollectionGetAllOptions.cs @@ -35,7 +35,5 @@ public MachineLearningModelVersionCollectionGetAllOptions() public string Feed { get; set; } /// View type for including/excluding (for example) archived entities. public MachineLearningListViewType? ListViewType { get; set; } - /// Model stage. - public string Stage { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs index 78a391d17add0..73bcc1a613643 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs @@ -44,18 +44,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteNull("flavors"); } } - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (Optional.IsDefined(JobName)) { if (JobName != null) @@ -109,18 +97,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteNull("stage"); } } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -218,13 +194,11 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning return null; } IDictionary flavors = default; - IntellectualProperty intellectualProperty = default; string jobName = default; string modelType = default; Uri modelUri = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -249,16 +223,6 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning flavors = dictionary; continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("jobName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -308,16 +272,6 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning stage = property.Value.GetString(); continue; } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -387,11 +341,9 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, flavors ?? new ChangeTrackingDictionary(), - intellectualProperty, jobName, modelType, modelUri, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs index 894645f87aae6..59e6668734377 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs @@ -24,20 +24,17 @@ public MachineLearningModelVersionProperties() /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Mapping of model flavors to their properties. - /// Intellectual Property details. Used if model is an Intellectual Property. /// Name of the training job which produced this model. /// The storage format for this entity. Used for NCD. /// The URI path to the model contents. /// Provisioning state for the model version. /// Stage in the model lifecycle assigned to this model. - internal MachineLearningModelVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, IDictionary flavors, IntellectualProperty intellectualProperty, string jobName, string modelType, Uri modelUri, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived) + internal MachineLearningModelVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IDictionary flavors, string jobName, string modelType, Uri modelUri, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) { Flavors = flavors; - IntellectualProperty = intellectualProperty; JobName = jobName; ModelType = modelType; ModelUri = modelUri; @@ -47,8 +44,6 @@ internal MachineLearningModelVersionProperties(string description, IDictionary Mapping of model flavors to their properties. public IDictionary Flavors { get; set; } - /// Intellectual Property details. Used if model is an Intellectual Property. - public IntellectualProperty IntellectualProperty { get; set; } /// Name of the training job which produced this model. public string JobName { get; set; } /// The storage format for this entity. Used for NCD. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs index b842051331e02..ebec68aa984c9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs @@ -33,28 +33,72 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,9 +139,17 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin } MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -116,6 +168,20 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -125,13 +191,68 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -139,6 +260,15 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -148,9 +278,17 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin return new MachineLearningNoneAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs index b191015d36fc0..80ed5abe5039c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,11 +23,19 @@ public MachineLearningNoneAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. - internal MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs index 9df72b7cedf6c..90771c71bc0b3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs @@ -24,7 +24,7 @@ public MachineLearningOnlineDeploymentProperties() /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs index dbdf005f4472f..faae447934575 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineRequestSettings.cs @@ -53,8 +53,9 @@ public MachineLearningOnlineRequestSettings() /// Initializes a new instance of . /// The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. /// - /// The maximum amount of time a request will stay in the queue in ISO 8601 format. + /// (Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the queue in ISO 8601 format. /// Defaults to 500ms. + /// (Now increase `request_timeout_ms` to account for any networking/queue delays) /// /// /// The scoring timeout in ISO 8601 format. @@ -72,8 +73,9 @@ internal MachineLearningOnlineRequestSettings(int? maxConcurrentRequestsPerInsta /// The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. public int? MaxConcurrentRequestsPerInstance { get; set; } /// - /// The maximum amount of time a request will stay in the queue in ISO 8601 format. + /// (Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the queue in ISO 8601 format. /// Defaults to 500ms. + /// (Now increase `request_timeout_ms` to account for any networking/queue delays) /// public TimeSpan? MaxQueueWait { get; set; } /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs index 7f3860bc2dd98..47201536eea78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs @@ -26,6 +26,7 @@ public MachineLearningOperationName(string value) private const string StartValue = "Start"; private const string StopValue = "Stop"; private const string RestartValue = "Restart"; + private const string ResizeValue = "Resize"; private const string ReimageValue = "Reimage"; private const string DeleteValue = "Delete"; @@ -37,6 +38,8 @@ public MachineLearningOperationName(string value) public static MachineLearningOperationName Stop { get; } = new MachineLearningOperationName(StopValue); /// Restart. public static MachineLearningOperationName Restart { get; } = new MachineLearningOperationName(RestartValue); + /// Resize. + public static MachineLearningOperationName Resize { get; } = new MachineLearningOperationName(ResizeValue); /// Reimage. public static MachineLearningOperationName Reimage { get; } = new MachineLearningOperationName(ReimageValue); /// Delete. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs index 4230c37905411..c6297a42b7fb1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs @@ -28,6 +28,7 @@ public MachineLearningOperationStatus(string value) private const string StartFailedValue = "StartFailed"; private const string StopFailedValue = "StopFailed"; private const string RestartFailedValue = "RestartFailed"; + private const string ResizeFailedValue = "ResizeFailed"; private const string ReimageFailedValue = "ReimageFailed"; private const string DeleteFailedValue = "DeleteFailed"; @@ -43,6 +44,8 @@ public MachineLearningOperationStatus(string value) public static MachineLearningOperationStatus StopFailed { get; } = new MachineLearningOperationStatus(StopFailedValue); /// RestartFailed. public static MachineLearningOperationStatus RestartFailed { get; } = new MachineLearningOperationStatus(RestartFailedValue); + /// ResizeFailed. + public static MachineLearningOperationStatus ResizeFailed { get; } = new MachineLearningOperationStatus(ResizeFailedValue); /// ReimageFailed. public static MachineLearningOperationStatus ReimageFailed { get; } = new MachineLearningOperationStatus(ReimageFailedValue); /// DeleteFailed. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs index 25a9b295e848d..7a02756a749d4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs @@ -31,6 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs index cabaf91430a04..c1ad233e93cf0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs @@ -52,16 +52,19 @@ public abstract partial class MachineLearningOutboundRule /// Initializes a new instance of . protected MachineLearningOutboundRule() { + ParentRuleNames = new ChangeTrackingList(); } /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. - internal MachineLearningOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) + internal MachineLearningOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) { Category = category; + ParentRuleNames = parentRuleNames; Status = status; OutboundRuleType = outboundRuleType; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -69,6 +72,8 @@ internal MachineLearningOutboundRule(OutboundRuleCategory? category, OutboundRul /// Category of a managed network Outbound Rule of a machine learning workspace. public OutboundRuleCategory? Category { get; set; } + /// Gets the parent rule names. + public IReadOnlyList ParentRuleNames { get; } /// Type of a managed network Outbound Rule of a machine learning workspace. public OutboundRuleStatus? Status { get; set; } /// Type of a managed network Outbound Rule of a machine learning workspace. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs index ccee14df39c86..59c7f0c4290ef 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine WorkspaceConnectionPersonalAccessToken credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine return new MachineLearningPatAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs index 1642b839696b2..78f1bb6726fde 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningPatAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionPersonalAccessToken credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionPersonalAccessToken credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs index 3e5626c71290e..1c100f0c20425 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs @@ -195,24 +195,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -335,7 +317,6 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -486,21 +467,6 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -584,7 +550,6 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, inputs ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs index b089670fcc8d7..9891a97bad117 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs @@ -41,7 +41,6 @@ public MachineLearningPipelineJob() /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -60,7 +59,7 @@ public MachineLearningPipelineJob() /// /// Pipeline settings, for things like ContinueRunOnStepFailure etc. /// ARM resource ID of source job. - internal MachineLearningPipelineJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, IDictionary inputs, IDictionary jobs, IDictionary outputs, BinaryData settings, ResourceIdentifier sourceJobId) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal MachineLearningPipelineJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, IDictionary inputs, IDictionary jobs, IDictionary outputs, BinaryData settings, ResourceIdentifier sourceJobId) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { Inputs = inputs; Jobs = jobs; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs index 1f7013a789463..c15e992ff0844 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.Serialization.cs @@ -43,35 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteNull("instanceType"); } } - if (Optional.IsCollectionDefined(Locations)) - { - if (Locations != null) - { - writer.WritePropertyName("locations"u8); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("locations"); - } - } - if (Optional.IsDefined(MaxInstanceCount)) - { - if (MaxInstanceCount != null) - { - writer.WritePropertyName("maxInstanceCount"u8); - writer.WriteNumberValue(MaxInstanceCount.Value); - } - else - { - writer.WriteNull("maxInstanceCount"); - } - } if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -142,8 +113,6 @@ internal static MachineLearningResourceConfiguration DeserializeMachineLearningR } int? instanceCount = default; string instanceType = default; - IList locations = default; - int? maxInstanceCount = default; IDictionary properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -168,31 +137,6 @@ internal static MachineLearningResourceConfiguration DeserializeMachineLearningR instanceType = property.Value.GetString(); continue; } - if (property.NameEquals("locations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - locations = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("maxInstanceCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxInstanceCount = null; - continue; - } - maxInstanceCount = property.Value.GetInt32(); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,13 +165,7 @@ internal static MachineLearningResourceConfiguration DeserializeMachineLearningR } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningResourceConfiguration( - instanceCount, - instanceType, - locations ?? new ChangeTrackingList(), - maxInstanceCount, - properties ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData); + return new MachineLearningResourceConfiguration(instanceCount, instanceType, properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs index ae9d5cfef3bca..e3181c69c35a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningResourceConfiguration.cs @@ -48,26 +48,18 @@ public partial class MachineLearningResourceConfiguration /// Initializes a new instance of . public MachineLearningResourceConfiguration() { - Locations = new ChangeTrackingList(); Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Optional number of instances or nodes used by the compute target. /// Optional type of VM used as supported by the compute target. - /// Locations where the job can run. - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// /// Additional properties bag. /// Keeps track of any properties unknown to the library. - internal MachineLearningResourceConfiguration(int? instanceCount, string instanceType, IList locations, int? maxInstanceCount, IDictionary properties, IDictionary serializedAdditionalRawData) + internal MachineLearningResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData) { InstanceCount = instanceCount; InstanceType = instanceType; - Locations = locations; - MaxInstanceCount = maxInstanceCount; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -76,13 +68,6 @@ internal MachineLearningResourceConfiguration(int? instanceCount, string instanc public int? InstanceCount { get; set; } /// Optional type of VM used as supported by the compute target. public string InstanceType { get; set; } - /// Locations where the job can run. - public IList Locations { get; set; } - /// - /// Optional max allowed number of instances or nodes to be used by the compute target. - /// For use with elastic training, currently supported by PyTorch distribution type only. - /// - public int? MaxInstanceCount { get; set; } /// /// Additional properties bag. /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs index b8ee1b8baaf7b..d55249f7f6dd8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine WorkspaceConnectionSharedAccessSignature credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine return new MachineLearningSasAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs index 8aad77a12a645..970cce1336077 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningSasAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionSharedAccessSignature credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionSharedAccessSignature credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs index f9437e3bb3b1e..e1d22fa44e9e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.Serialization.cs @@ -72,7 +72,6 @@ internal static MachineLearningScheduleAction DeserializeMachineLearningSchedule { case "CreateJob": return MachineLearningJobScheduleAction.DeserializeMachineLearningJobScheduleAction(element, options); case "CreateMonitor": return CreateMonitorAction.DeserializeCreateMonitorAction(element, options); - case "ImportData": return ImportDataAction.DeserializeImportDataAction(element, options); case "InvokeBatchEndpoint": return MachineLearningEndpointScheduleAction.DeserializeMachineLearningEndpointScheduleAction(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs index ce59b32dbc5db..96213f32518e7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleAction.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public abstract partial class MachineLearningScheduleAction { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs index 9fcd369dded44..b011f9ad9a545 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs @@ -17,7 +17,7 @@ public partial class MachineLearningScheduleProperties : MachineLearningResource /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// /// [Required] Specifies the trigger details @@ -42,7 +42,7 @@ public MachineLearningScheduleProperties(MachineLearningScheduleAction action, M /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// Display name of schedule. /// Is the schedule enabled?. @@ -69,7 +69,7 @@ internal MachineLearningScheduleProperties() /// /// [Required] Specifies the action of the schedule /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public MachineLearningScheduleAction Action { get; set; } /// Display name of schedule. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs index e3b590d86bb49..4a037be4b4579 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs @@ -178,24 +178,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -322,7 +304,6 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -480,21 +461,6 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -578,7 +544,6 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, earlyTermination, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs index 485070c4cbd4f..e6a36abd77e42 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs @@ -58,7 +58,6 @@ public MachineLearningSweepJob(MachineLearningObjective objective, SamplingAlgor /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -89,7 +88,7 @@ public MachineLearningSweepJob(MachineLearningObjective objective, SamplingAlgor /// /// [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. /// [Required] Trial component definition. - internal MachineLearningSweepJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, MachineLearningEarlyTerminationPolicy earlyTermination, IDictionary inputs, MachineLearningSweepJobLimits limits, MachineLearningObjective objective, IDictionary outputs, JobQueueSettings queueSettings, SamplingAlgorithm samplingAlgorithm, BinaryData searchSpace, MachineLearningTrialComponent trial) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal MachineLearningSweepJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, MachineLearningEarlyTerminationPolicy earlyTermination, IDictionary inputs, MachineLearningSweepJobLimits limits, MachineLearningObjective objective, IDictionary outputs, JobQueueSettings queueSettings, SamplingAlgorithm samplingAlgorithm, BinaryData searchSpace, MachineLearningTrialComponent trial) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { EarlyTermination = earlyTermination; Inputs = inputs; @@ -131,7 +130,19 @@ internal MachineLearningSweepJob() /// public IDictionary Outputs { get; set; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// /// [Required] The hyperparameter sampling algorithm /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs index b341d71385477..531367a1c5530 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs @@ -52,42 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -187,9 +151,6 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement IList referencedUris = default; MachineLearningDataType dataType = default; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -231,36 +192,6 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -330,13 +261,10 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, - intellectualProperty, - stage, referencedUris ?? new ChangeTrackingList()); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs index 63da2b10c6565..2d7ee18335fcb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs @@ -29,15 +29,12 @@ public MachineLearningTable(Uri dataUri) : base(dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. /// Uris referenced in the MLTable definition (required for lineage). - internal MachineLearningTable(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage, IList referencedUris) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal MachineLearningTable(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IList referencedUris) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { ReferencedUris = referencedUris; DataType = dataType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs index 3d33c7164a2e7..e0ae676b51280 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningTableJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningTableJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs index 01af9cb3e1ae4..7ccc97f227f38 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningTableJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningTableJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningTableJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs index 46d6edb69d874..28e2d071730f9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs @@ -68,11 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -118,7 +113,6 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -187,15 +181,6 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -210,7 +195,6 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs index 43475454b5761..4f7d3b4e49768 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs @@ -61,13 +61,8 @@ public MachineLearningTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. - internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData) + internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData) { IsDnnTrainingEnabled = isDnnTrainingEnabled; IsModelExplainabilityEnabled = isModelExplainabilityEnabled; @@ -76,7 +71,6 @@ internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isMod IsVoteEnsembleEnabled = isVoteEnsembleEnabled; EnsembleModelDownloadTimeout = ensembleModelDownloadTimeout; StackEnsembleSettings = stackEnsembleSettings; - TrainingMode = trainingMode; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,11 +91,5 @@ internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isMod public TimeSpan? EnsembleModelDownloadTimeout { get; set; } /// Stack ensemble settings for stack ensemble run. public MachineLearningStackEnsembleSettings StackEnsembleSettings { get; set; } - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// - public TrainingMode? TrainingMode { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs index 8d1d20ac08e20..1488e8ba27074 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs @@ -66,7 +66,7 @@ public MachineLearningTrialComponent(string command, ResourceIdentifier environm /// /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// /// [Required] The ARM resource ID of the Environment specification for the job. /// Environment variables included in the job. @@ -95,7 +95,7 @@ internal MachineLearningTrialComponent() /// /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , and . /// public MachineLearningDistributionConfiguration Distribution { get; set; } /// [Required] The ARM resource ID of the Environment specification for the job. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerType.cs index dbd3a9b86dc84..be4c7025c4837 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerType.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// The MachineLearningTriggerType. - public readonly partial struct MachineLearningTriggerType : IEquatable + internal readonly partial struct MachineLearningTriggerType : IEquatable { private readonly string _value; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs index a44b78a2780b5..24f607a237514 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningTritonModelJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningTritonModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs index 557b4b8a3c391..6b1adb8a10190 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningTritonModelJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningTritonModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningTritonModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs index 056d3ffd26baf..82cb1403705cc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs @@ -30,42 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -164,9 +128,6 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF } MachineLearningDataType dataType = default; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -186,36 +147,6 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -285,13 +216,10 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, - dataUri, - intellectualProperty, - stage); + dataUri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs index 4c3a49c0afec9..014754d285aed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs @@ -28,14 +28,11 @@ public MachineLearningUriFileDataVersion(Uri dataUri) : base(dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal MachineLearningUriFileDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal MachineLearningUriFileDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs index 8545d46931979..968bf30fce756 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningUriFileJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningUriFileJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs index ef454747600ef..75989ed6f5553 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningUriFileJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningUriFileJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningUriFileJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs index 814468f662e36..ab3582a8a149b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs @@ -30,42 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -164,9 +128,6 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr } MachineLearningDataType dataType = default; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -186,36 +147,6 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -285,13 +216,10 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, - dataUri, - intellectualProperty, - stage); + dataUri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs index b2cdfded89083..079791aabfd84 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs @@ -28,14 +28,11 @@ public MachineLearningUriFolderDataVersion(Uri dataUri) : base(dataUri) /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal MachineLearningUriFolderDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal MachineLearningUriFolderDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs index 720b213a5f1b8..edbc33a33ac2d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs @@ -26,42 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(AssetName)) - { - if (AssetName != null) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - else - { - writer.WriteNull("assetName"); - } - } - if (Optional.IsDefined(AssetVersion)) - { - if (AssetVersion != null) - { - writer.WritePropertyName("assetVersion"u8); - writer.WriteStringValue(AssetVersion); - } - else - { - writer.WriteNull("assetVersion"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -131,9 +95,6 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF { return null; } - string assetName = default; - string assetVersion = default; - AutoDeleteSetting autoDeleteSetting = default; MachineLearningOutputDeliveryMode? mode = default; Uri uri = default; string description = default; @@ -142,36 +103,6 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("assetName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetName = null; - continue; - } - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("assetVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - assetVersion = null; - continue; - } - assetVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -212,15 +143,7 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningUriFolderJobOutput( - description, - jobOutputType, - serializedAdditionalRawData, - assetName, - assetVersion, - autoDeleteSetting, - mode, - uri); + return new MachineLearningUriFolderJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs index 6fe281da22fbd..36bafc62e0455 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs @@ -23,27 +23,15 @@ public MachineLearningUriFolderJobOutput() /// Description for the output. /// [Required] Specifies the type of job. /// Keeps track of any properties unknown to the library. - /// Output Asset Name. - /// Output Asset Version. - /// Auto delete setting of output data asset. /// Output Asset Delivery Mode. /// Output Asset URI. - internal MachineLearningUriFolderJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, string assetName, string assetVersion, AutoDeleteSetting autoDeleteSetting, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + internal MachineLearningUriFolderJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) { - AssetName = assetName; - AssetVersion = assetVersion; - AutoDeleteSetting = autoDeleteSetting; Mode = mode; Uri = uri; JobOutputType = jobOutputType; } - /// Output Asset Name. - public string AssetName { get; set; } - /// Output Asset Version. - public string AssetVersion { get; set; } - /// Auto delete setting of output data asset. - public AutoDeleteSetting AutoDeleteSetting { get; set; } /// Output Asset Delivery Mode. public MachineLearningOutputDeliveryMode? Mode { get; set; } /// Output Asset URI. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs index 7e6202b7a4a7b..fe22e39d41553 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Writ writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser MachineLearningWorkspaceConnectionUsernamePassword credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser return new MachineLearningUsernamePasswordAuthTypeWorkspaceConnection( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs index 7a255e4425f89..cd667ba3a7ace 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public MachineLearningUsernamePasswordAuthTypeWorkspaceConnection() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionUsernamePassword credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionUsernamePassword credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs index c8a93becf429c..a3b3d1abed5b5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs @@ -54,7 +54,7 @@ public MachineLearningWorkspaceConnectionPatch() /// /// The properties that the machine learning workspace connection will be updated with. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// /// Keeps track of any properties unknown to the library. internal MachineLearningWorkspaceConnectionPatch(MachineLearningWorkspaceConnectionProperties properties, IDictionary serializedAdditionalRawData) @@ -66,7 +66,7 @@ internal MachineLearningWorkspaceConnectionPatch(MachineLearningWorkspaceConnect /// /// The properties that the machine learning workspace connection will be updated with. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// public MachineLearningWorkspaceConnectionProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs index 743da0b3c84b3..80daf5ac889a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs @@ -33,28 +33,72 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WriteStringValue(item); } -#endif + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -97,11 +141,14 @@ internal static MachineLearningWorkspaceConnectionProperties DeserializeMachineL { switch (discriminator.GetString()) { + case "AAD": return AadAuthTypeWorkspaceConnectionProperties.DeserializeAadAuthTypeWorkspaceConnectionProperties(element, options); case "AccessKey": return AccessKeyAuthTypeWorkspaceConnectionProperties.DeserializeAccessKeyAuthTypeWorkspaceConnectionProperties(element, options); + case "AccountKey": return AccountKeyAuthTypeWorkspaceConnectionProperties.DeserializeAccountKeyAuthTypeWorkspaceConnectionProperties(element, options); case "ApiKey": return ApiKeyAuthWorkspaceConnectionProperties.DeserializeApiKeyAuthWorkspaceConnectionProperties(element, options); case "CustomKeys": return CustomKeysWorkspaceConnectionProperties.DeserializeCustomKeysWorkspaceConnectionProperties(element, options); case "ManagedIdentity": return MachineLearningManagedIdentityAuthTypeWorkspaceConnection.DeserializeMachineLearningManagedIdentityAuthTypeWorkspaceConnection(element, options); case "None": return MachineLearningNoneAuthTypeWorkspaceConnection.DeserializeMachineLearningNoneAuthTypeWorkspaceConnection(element, options); + case "OAuth2": return OAuth2AuthTypeWorkspaceConnectionProperties.DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(element, options); case "PAT": return MachineLearningPatAuthTypeWorkspaceConnection.DeserializeMachineLearningPatAuthTypeWorkspaceConnection(element, options); case "SAS": return MachineLearningSasAuthTypeWorkspaceConnection.DeserializeMachineLearningSasAuthTypeWorkspaceConnection(element, options); case "ServicePrincipal": return ServicePrincipalAuthTypeWorkspaceConnectionProperties.DeserializeServicePrincipalAuthTypeWorkspaceConnectionProperties(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs index 884634891b753..34c3f544b06a6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs @@ -7,12 +7,13 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , and . + /// The available derived classes include , , , , , , , , , , and . /// public abstract partial class MachineLearningWorkspaceConnectionProperties { @@ -51,22 +52,40 @@ public abstract partial class MachineLearningWorkspaceConnectionProperties /// Initializes a new instance of . protected MachineLearningWorkspaceConnectionProperties() { + Metadata = new ChangeTrackingDictionary(); + SharedUserList = new ChangeTrackingList(); } /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) { AuthType = authType; Category = category; + CreatedByWorkspaceArmId = createdByWorkspaceArmId; + Error = error; ExpiryOn = expiryOn; + Group = group; + IsSharedToAll = isSharedToAll; Metadata = metadata; + PeRequirement = peRequirement; + PeStatus = peStatus; + SharedUserList = sharedUserList; Target = target; + UseWorkspaceManagedIdentity = useWorkspaceManagedIdentity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,40 +93,27 @@ internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionA internal MachineLearningConnectionAuthType AuthType { get; set; } /// Category of the connection. public MachineLearningConnectionCategory? Category { get; set; } + /// Gets the created by workspace arm id. + public ResourceIdentifier CreatedByWorkspaceArmId { get; } + /// Gets or sets the error. + public string Error { get; set; } /// Gets or sets the expiry on. public DateTimeOffset? ExpiryOn { get; set; } - /// - /// Any object - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Metadata { get; set; } + /// Group based on connection category. + public ConnectionGroup? Group { get; } + /// Gets or sets the is shared to all. + public bool? IsSharedToAll { get; set; } + /// Store user metadata for this connection. + public IDictionary Metadata { get; } + /// Gets or sets the pe requirement. + public ManagedPERequirement? PeRequirement { get; set; } + /// Gets or sets the pe status. + public ManagedPEStatus? PeStatus { get; set; } + /// Gets the shared user list. + public IList SharedUserList { get; } /// Gets or sets the target. public string Target { get; set; } + /// Gets or sets the use workspace managed identity. + public bool? UseWorkspaceManagedIdentity { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs index 6be22d86f8f73..23391ec0bf2ac 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs @@ -31,6 +31,11 @@ void IJsonModel.Write(Utf8Js writer.WritePropertyName("password"u8); writer.WriteStringValue(Password); } + if (Optional.IsDefined(SecurityToken)) + { + writer.WritePropertyName("securityToken"u8); + writer.WriteStringValue(SecurityToken); + } if (Optional.IsDefined(Username)) { writer.WritePropertyName("username"u8); @@ -75,6 +80,7 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa return null; } string password = default; + string securityToken = default; string username = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,6 +91,11 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa password = property.Value.GetString(); continue; } + if (property.NameEquals("securityToken"u8)) + { + securityToken = property.Value.GetString(); + continue; + } if (property.NameEquals("username"u8)) { username = property.Value.GetString(); @@ -96,7 +107,7 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningWorkspaceConnectionUsernamePassword(password, username, serializedAdditionalRawData); + return new MachineLearningWorkspaceConnectionUsernamePassword(password, securityToken, username, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs index 5af53ce2289a6..0c3b16ed57d00 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs @@ -52,17 +52,21 @@ public MachineLearningWorkspaceConnectionUsernamePassword() /// Initializes a new instance of . /// + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. /// /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceConnectionUsernamePassword(string password, string username, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspaceConnectionUsernamePassword(string password, string securityToken, string username, IDictionary serializedAdditionalRawData) { Password = password; + SecurityToken = securityToken; Username = username; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Gets or sets the password. public string Password { get; set; } + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. + public string SecurityToken { get; set; } /// Gets or sets the username. public string Username { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs index 02057d2865c91..9defbeeafb8ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs @@ -160,6 +160,29 @@ void IJsonModel.Write(Utf8JsonWriter { JsonSerializer.Serialize(writer, document.RootElement); } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(RequiredResourceProviders)) + { + writer.WritePropertyName("requiredResourceProviders"u8); + writer.WriteStartObject(); + foreach (var item in RequiredResourceProviders) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } #endif } writer.WriteEndObject(); @@ -277,6 +300,7 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea IDictionary keyVault = default; IDictionary nsg = default; IDictionary others = default; + IDictionary requiredResourceProviders = default; IDictionary resourceLock = default; IDictionary storageAccount = default; IDictionary udr = default; @@ -410,6 +434,27 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea others = dictionary; continue; } + if (property.NameEquals("requiredResourceProviders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + requiredResourceProviders = dictionary; + continue; + } if (property.NameEquals("resourceLock"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -486,6 +531,7 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea keyVault ?? new ChangeTrackingDictionary(), nsg ?? new ChangeTrackingDictionary(), others ?? new ChangeTrackingDictionary(), + requiredResourceProviders ?? new ChangeTrackingDictionary(), resourceLock ?? new ChangeTrackingDictionary(), storageAccount ?? new ChangeTrackingDictionary(), udr ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs index d35c33788d318..464e4d55b3a06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs @@ -54,6 +54,7 @@ public MachineLearningWorkspaceDiagnoseProperties() KeyVault = new ChangeTrackingDictionary(); Nsg = new ChangeTrackingDictionary(); Others = new ChangeTrackingDictionary(); + RequiredResourceProviders = new ChangeTrackingDictionary(); ResourceLock = new ChangeTrackingDictionary(); StorageAccount = new ChangeTrackingDictionary(); Udr = new ChangeTrackingDictionary(); @@ -66,11 +67,12 @@ public MachineLearningWorkspaceDiagnoseProperties() /// Setting for diagnosing dependent key vault. /// Setting for diagnosing network security group. /// Setting for diagnosing unclassified category of problems. + /// Setting for diagnosing the presence of required resource providers in the workspace. /// Setting for diagnosing resource lock. /// Setting for diagnosing dependent storage account. /// Setting for diagnosing user defined routing. /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspaceDiagnoseProperties(IDictionary applicationInsights, IDictionary containerRegistry, IDictionary dnsResolution, IDictionary keyVault, IDictionary nsg, IDictionary others, IDictionary resourceLock, IDictionary storageAccount, IDictionary udr, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspaceDiagnoseProperties(IDictionary applicationInsights, IDictionary containerRegistry, IDictionary dnsResolution, IDictionary keyVault, IDictionary nsg, IDictionary others, IDictionary requiredResourceProviders, IDictionary resourceLock, IDictionary storageAccount, IDictionary udr, IDictionary serializedAdditionalRawData) { ApplicationInsights = applicationInsights; ContainerRegistry = containerRegistry; @@ -78,6 +80,7 @@ internal MachineLearningWorkspaceDiagnoseProperties(IDictionary public IDictionary Others { get; } /// + /// Setting for diagnosing the presence of required resource providers in the workspace. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary RequiredResourceProviders { get; } + /// /// Setting for diagnosing resource lock /// /// To assign an object to the value of this property use . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs index 09106307cb581..bad217ca2fa1f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs @@ -51,6 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (Optional.IsDefined(AllowRoleAssignmentOnRG)) + { + writer.WritePropertyName("allowRoleAssignmentOnRG"u8); + writer.WriteBooleanValue(AllowRoleAssignmentOnRG.Value); + } if (Optional.IsDefined(ApplicationInsights)) { writer.WritePropertyName("applicationInsights"u8); @@ -71,6 +76,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("enableDataIsolation"u8); writer.WriteBooleanValue(EnableDataIsolation.Value); } + if (Optional.IsDefined(EnableSoftwareBillOfMaterials)) + { + writer.WritePropertyName("enableSoftwareBillOfMaterials"u8); + writer.WriteBooleanValue(EnableSoftwareBillOfMaterials.Value); + } if (Optional.IsDefined(Encryption)) { writer.WritePropertyName("encryption"u8); @@ -91,6 +101,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("imageBuildCompute"u8); writer.WriteStringValue(ImageBuildCompute); } + if (Optional.IsCollectionDefined(IPAllowlist)) + { + writer.WritePropertyName("ipAllowlist"u8); + writer.WriteStartArray(); + foreach (var item in IPAllowlist) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(ManagedNetwork)) { writer.WritePropertyName("managedNetwork"u8); @@ -106,6 +126,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("publicNetworkAccess"u8); writer.WriteStringValue(PublicNetworkAccessType.Value.ToString()); } + if (Optional.IsDefined(ServerlessComputeSettings)) + { + writer.WritePropertyName("serverlessComputeSettings"u8); + writer.WriteObjectValue(ServerlessComputeSettings, options); + } if (Optional.IsDefined(ServiceManagedResourcesSettings)) { writer.WritePropertyName("serviceManagedResourcesSettings"u8); @@ -163,17 +188,21 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac ManagedServiceIdentity identity = default; MachineLearningSku sku = default; IDictionary tags = default; + bool? allowRoleAssignmentOnRG = default; string applicationInsights = default; string containerRegistry = default; string description = default; bool? enableDataIsolation = default; + bool? enableSoftwareBillOfMaterials = default; EncryptionUpdateProperties encryption = default; FeatureStoreSettings featureStoreSettings = default; string friendlyName = default; string imageBuildCompute = default; + IList ipAllowlist = default; ManagedNetworkSettings managedNetwork = default; string primaryUserAssignedIdentity = default; MachineLearningPublicNetworkAccessType? publicNetworkAccess = default; + ServerlessComputeSettings serverlessComputeSettings = default; ServiceManagedResourcesSettings serviceManagedResourcesSettings = default; int? softDeleteRetentionInDays = default; bool? v1LegacyMode = default; @@ -223,6 +252,15 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("allowRoleAssignmentOnRG"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowRoleAssignmentOnRG = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("applicationInsights"u8)) { applicationInsights = property0.Value.GetString(); @@ -247,6 +285,15 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac enableDataIsolation = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableSoftwareBillOfMaterials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSoftwareBillOfMaterials = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("encryption"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +322,20 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac imageBuildCompute = property0.Value.GetString(); continue; } + if (property0.NameEquals("ipAllowlist"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAllowlist = array; + continue; + } if (property0.NameEquals("managedNetwork"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -298,6 +359,15 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac publicNetworkAccess = new MachineLearningPublicNetworkAccessType(property0.Value.GetString()); continue; } + if (property0.NameEquals("serverlessComputeSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); + continue; + } if (property0.NameEquals("serviceManagedResourcesSettings"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -338,17 +408,21 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac identity, sku, tags ?? new ChangeTrackingDictionary(), + allowRoleAssignmentOnRG, applicationInsights, containerRegistry, description, enableDataIsolation, + enableSoftwareBillOfMaterials, encryption, featureStoreSettings, friendlyName, imageBuildCompute, + ipAllowlist ?? new ChangeTrackingList(), managedNetwork, primaryUserAssignedIdentity, publicNetworkAccess, + serverlessComputeSettings, serviceManagedResourcesSettings, softDeleteRetentionInDays, v1LegacyMode, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs index ac49c6c97791c..98a25d81437c4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs @@ -50,43 +50,52 @@ public partial class MachineLearningWorkspacePatch public MachineLearningWorkspacePatch() { Tags = new ChangeTrackingDictionary(); + IPAllowlist = new ChangeTrackingList(); } /// Initializes a new instance of . /// Managed service identity (system assigned and/or user assigned identities). /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. /// The resource tags for the machine learning workspace. + /// /// ARM id of the application insights associated with this workspace. /// ARM id of the container registry associated with this workspace. /// The description of this workspace. /// + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. /// /// Settings for feature store type workspace. /// The friendly name for this workspace. This name in mutable. /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. /// Managed Network settings for a machine learning workspace. /// The user assigned identity resource id that represents the workspace identity. /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. /// The service managed resource settings. /// Retention time in days after workspace get soft deleted. /// Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. /// Keeps track of any properties unknown to the library. - internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineLearningSku sku, IDictionary tags, string applicationInsights, string containerRegistry, string description, bool? enableDataIsolation, EncryptionUpdateProperties encryption, FeatureStoreSettings featureStoreSettings, string friendlyName, string imageBuildCompute, ManagedNetworkSettings managedNetwork, string primaryUserAssignedIdentity, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServiceManagedResourcesSettings serviceManagedResourcesSettings, int? softDeleteRetentionInDays, bool? v1LegacyMode, IDictionary serializedAdditionalRawData) + internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineLearningSku sku, IDictionary tags, bool? allowRoleAssignmentOnRG, string applicationInsights, string containerRegistry, string description, bool? enableDataIsolation, bool? enableSoftwareBillOfMaterials, EncryptionUpdateProperties encryption, FeatureStoreSettings featureStoreSettings, string friendlyName, string imageBuildCompute, IList ipAllowlist, ManagedNetworkSettings managedNetwork, string primaryUserAssignedIdentity, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServerlessComputeSettings serverlessComputeSettings, ServiceManagedResourcesSettings serviceManagedResourcesSettings, int? softDeleteRetentionInDays, bool? v1LegacyMode, IDictionary serializedAdditionalRawData) { Identity = identity; Sku = sku; Tags = tags; + AllowRoleAssignmentOnRG = allowRoleAssignmentOnRG; ApplicationInsights = applicationInsights; ContainerRegistry = containerRegistry; Description = description; EnableDataIsolation = enableDataIsolation; + EnableSoftwareBillOfMaterials = enableSoftwareBillOfMaterials; Encryption = encryption; FeatureStoreSettings = featureStoreSettings; FriendlyName = friendlyName; ImageBuildCompute = imageBuildCompute; + IPAllowlist = ipAllowlist; ManagedNetwork = managedNetwork; PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; PublicNetworkAccessType = publicNetworkAccessType; + ServerlessComputeSettings = serverlessComputeSettings; ServiceManagedResourcesSettings = serviceManagedResourcesSettings; SoftDeleteRetentionInDays = softDeleteRetentionInDays; V1LegacyMode = v1LegacyMode; @@ -99,6 +108,8 @@ internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineL public MachineLearningSku Sku { get; set; } /// The resource tags for the machine learning workspace. public IDictionary Tags { get; } + /// Gets or sets the allow role assignment on rg. + public bool? AllowRoleAssignmentOnRG { get; set; } /// ARM id of the application insights associated with this workspace. public string ApplicationInsights { get; set; } /// ARM id of the container registry associated with this workspace. @@ -107,6 +118,8 @@ internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineL public string Description { get; set; } /// Gets or sets the enable data isolation. public bool? EnableDataIsolation { get; set; } + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + public bool? EnableSoftwareBillOfMaterials { get; set; } /// Gets or sets the encryption. internal EncryptionUpdateProperties Encryption { get; set; } /// Gets or sets the key identifier. @@ -122,12 +135,16 @@ public string KeyIdentifier public string FriendlyName { get; set; } /// The compute name for image build. public string ImageBuildCompute { get; set; } + /// The list of IPv4 addresses that are allowed to access the workspace. + public IList IPAllowlist { get; } /// Managed Network settings for a machine learning workspace. public ManagedNetworkSettings ManagedNetwork { get; set; } /// The user assigned identity resource id that represents the workspace identity. public string PrimaryUserAssignedIdentity { get; set; } /// Whether requests from Public Network are allowed. public MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get; set; } + /// Settings for serverless compute in a workspace. + public ServerlessComputeSettings ServerlessComputeSettings { get; set; } /// The service managed resource settings. internal ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } /// Gets or sets the cosmos db collections throughput. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs index bf9c7517553b2..75ea8e2ab6802 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedComputeIdentity.cs @@ -21,16 +21,16 @@ public ManagedComputeIdentity() } /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. - /// Managed service identity (system assigned and/or user assigned identities). + /// The identity which will be leveraged by the monitoring jobs. internal ManagedComputeIdentity(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData, ManagedServiceIdentity identity) : base(computeIdentityType, serializedAdditionalRawData) { Identity = identity; ComputeIdentityType = computeIdentityType; } - /// Managed service identity (system assigned and/or user assigned identities). + /// The identity which will be leveraged by the monitoring jobs. public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs new file mode 100644 index 0000000000000..98e898af65f2d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedIdentityCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ManagedIdentityType)) + { + if (ManagedIdentityType != null) + { + writer.WritePropertyName("managedIdentityType"u8); + writer.WriteStringValue(ManagedIdentityType); + } + else + { + writer.WriteNull("managedIdentityType"); + } + } + if (Optional.IsDefined(UserManagedIdentityClientId)) + { + if (UserManagedIdentityClientId != null) + { + writer.WritePropertyName("userManagedIdentityClientId"u8); + writer.WriteStringValue(UserManagedIdentityClientId); + } + else + { + writer.WriteNull("userManagedIdentityClientId"); + } + } + if (Optional.IsDefined(UserManagedIdentityPrincipalId)) + { + if (UserManagedIdentityPrincipalId != null) + { + writer.WritePropertyName("userManagedIdentityPrincipalId"u8); + writer.WriteStringValue(UserManagedIdentityPrincipalId); + } + else + { + writer.WriteNull("userManagedIdentityPrincipalId"); + } + } + if (Optional.IsDefined(UserManagedIdentityResourceId)) + { + if (UserManagedIdentityResourceId != null) + { + writer.WritePropertyName("userManagedIdentityResourceId"u8); + writer.WriteStringValue(UserManagedIdentityResourceId); + } + else + { + writer.WriteNull("userManagedIdentityResourceId"); + } + } + if (Optional.IsDefined(UserManagedIdentityTenantId)) + { + if (UserManagedIdentityTenantId != null) + { + writer.WritePropertyName("userManagedIdentityTenantId"u8); + writer.WriteStringValue(UserManagedIdentityTenantId); + } + else + { + writer.WriteNull("userManagedIdentityTenantId"); + } + } + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedIdentityCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedIdentityCredential(document.RootElement, options); + } + + internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string managedIdentityType = default; + string userManagedIdentityClientId = default; + string userManagedIdentityPrincipalId = default; + string userManagedIdentityResourceId = default; + string userManagedIdentityTenantId = default; + DataReferenceCredentialType credentialType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("managedIdentityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + managedIdentityType = null; + continue; + } + managedIdentityType = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityClientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityClientId = null; + continue; + } + userManagedIdentityClientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityPrincipalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityPrincipalId = null; + continue; + } + userManagedIdentityPrincipalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityResourceId = null; + continue; + } + userManagedIdentityResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userManagedIdentityTenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityTenantId = null; + continue; + } + userManagedIdentityTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("credentialType"u8)) + { + credentialType = new DataReferenceCredentialType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedIdentityCredential( + credentialType, + serializedAdditionalRawData, + managedIdentityType, + userManagedIdentityClientId, + userManagedIdentityPrincipalId, + userManagedIdentityResourceId, + userManagedIdentityTenantId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support writing '{options.Format}' format."); + } + } + + ManagedIdentityCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedIdentityCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedIdentityCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs new file mode 100644 index 0000000000000..555a30e411cc1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Credential for user managed identity. + public partial class ManagedIdentityCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal ManagedIdentityCredential() + { + CredentialType = DataReferenceCredentialType.ManagedIdentity; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + /// ManagedIdentityCredential identity type. + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + internal ManagedIdentityCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string managedIdentityType, string userManagedIdentityClientId, string userManagedIdentityPrincipalId, string userManagedIdentityResourceId, string userManagedIdentityTenantId) : base(credentialType, serializedAdditionalRawData) + { + ManagedIdentityType = managedIdentityType; + UserManagedIdentityClientId = userManagedIdentityClientId; + UserManagedIdentityPrincipalId = userManagedIdentityPrincipalId; + UserManagedIdentityResourceId = userManagedIdentityResourceId; + UserManagedIdentityTenantId = userManagedIdentityTenantId; + CredentialType = credentialType; + } + + /// ManagedIdentityCredential identity type. + public string ManagedIdentityType { get; } + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityClientId { get; } + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityPrincipalId { get; } + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityResourceId { get; } + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityTenantId { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs index 5f6dbcba59008..2c63996e8dfdd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs @@ -59,6 +59,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("status"u8); writer.WriteObjectValue(Status, options); } + if (options.Format != "W" && Optional.IsCollectionDefined(ChangeableIsolationModes)) + { + writer.WritePropertyName("changeableIsolationModes"u8); + writer.WriteStartArray(); + foreach (var item in ChangeableIsolationModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,6 +111,7 @@ internal static ManagedNetworkSettings DeserializeManagedNetworkSettings(JsonEle string networkId = default; IDictionary outboundRules = default; ManagedNetworkProvisionStatus status = default; + IReadOnlyList changeableIsolationModes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -143,13 +154,33 @@ internal static ManagedNetworkSettings DeserializeManagedNetworkSettings(JsonEle status = ManagedNetworkProvisionStatus.DeserializeManagedNetworkProvisionStatus(property.Value, options); continue; } + if (property.NameEquals("changeableIsolationModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new IsolationMode(item.GetString())); + } + changeableIsolationModes = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedNetworkSettings(isolationMode, networkId, outboundRules ?? new ChangeTrackingDictionary(), status, serializedAdditionalRawData); + return new ManagedNetworkSettings( + isolationMode, + networkId, + outboundRules ?? new ChangeTrackingDictionary(), + status, + changeableIsolationModes ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs index 57c04e669be17..6a50509cb982e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs @@ -49,6 +49,7 @@ public partial class ManagedNetworkSettings public ManagedNetworkSettings() { OutboundRules = new ChangeTrackingDictionary(); + ChangeableIsolationModes = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -60,13 +61,15 @@ public ManagedNetworkSettings() /// The available derived classes include , and . /// /// Status of the Provisioning for the managed network of a machine learning workspace. + /// /// Keeps track of any properties unknown to the library. - internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, IDictionary outboundRules, ManagedNetworkProvisionStatus status, IDictionary serializedAdditionalRawData) + internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, IDictionary outboundRules, ManagedNetworkProvisionStatus status, IReadOnlyList changeableIsolationModes, IDictionary serializedAdditionalRawData) { IsolationMode = isolationMode; NetworkId = networkId; OutboundRules = outboundRules; Status = status; + ChangeableIsolationModes = changeableIsolationModes; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,5 +85,7 @@ internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, public IDictionary OutboundRules { get; set; } /// Status of the Provisioning for the managed network of a machine learning workspace. public ManagedNetworkProvisionStatus Status { get; set; } + /// Gets the changeable isolation modes. + public IReadOnlyList ChangeableIsolationModes { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..0618aa7bc1e41 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedOnlineEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(EndpointComputeType)) + { + writer.WritePropertyName("endpointComputeType"u8); + writer.WriteStringValue(EndpointComputeType.Value.ToString()); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedOnlineEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnlineEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static ManagedOnlineEndpointDeploymentResourceProperties DeserializeManagedOnlineEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningEndpointComputeType? endpointComputeType = default; + string model = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointComputeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointComputeType = new MachineLearningEndpointComputeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnlineEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + endpointComputeType, + model); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnlineEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnlineEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..44f2699f74f92 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedOnlineEndpointDeploymentResourceProperties. + public partial class ManagedOnlineEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + public ManagedOnlineEndpointDeploymentResourceProperties() + { + EndpointDeploymentResourcePropertiesType = "managedOnlineEndpoint"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Enum to determine endpoint compute type. + /// + internal ManagedOnlineEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, MachineLearningEndpointComputeType? endpointComputeType, string model) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + EndpointComputeType = endpointComputeType; + Model = model; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "managedOnlineEndpoint"; + } + + /// Enum to determine endpoint compute type. + public MachineLearningEndpointComputeType? EndpointComputeType { get; set; } + /// Gets or sets the model. + public string Model { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..630b2660c608f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedOnlineEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } + if (Optional.IsDefined(Compute)) + { + writer.WritePropertyName("compute"u8); + writer.WriteStringValue(Compute); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(MirrorTraffic)) + { + writer.WritePropertyName("mirrorTraffic"u8); + writer.WriteStartObject(); + foreach (var item in MirrorTraffic) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(ScoringUri)) + { + writer.WritePropertyName("scoringUri"u8); + writer.WriteStringValue(ScoringUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Traffic)) + { + writer.WritePropertyName("traffic"u8); + writer.WriteStartObject(); + foreach (var item in Traffic) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedOnlineEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnlineEndpointResourceProperties(document.RootElement, options); + } + + internal static ManagedOnlineEndpointResourceProperties DeserializeManagedOnlineEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningEndpointAuthMode? authMode = default; + string compute = default; + string description = default; + IDictionary mirrorTraffic = default; + Uri scoringUri = default; + IDictionary traffic = default; + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new MachineLearningEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("compute"u8)) + { + compute = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("mirrorTraffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + mirrorTraffic = dictionary; + continue; + } + if (property.NameEquals("scoringUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scoringUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("traffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + traffic = dictionary; + continue; + } + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnlineEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData, + authMode, + compute, + description, + mirrorTraffic ?? new ChangeTrackingDictionary(), + scoringUri, + traffic ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnlineEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnlineEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs new file mode 100644 index 0000000000000..c88617aa3005a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedOnlineEndpointResourceProperties. + public partial class ManagedOnlineEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ManagedOnlineEndpointResourceProperties() + { + MirrorTraffic = new ChangeTrackingDictionary(); + Traffic = new ChangeTrackingDictionary(); + EndpointType = EndpointType.ManagedOnlineEndpoint; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + /// Enum to determine endpoint authentication mode. + /// + /// + /// Dictionary of <integer>. + /// + /// Dictionary of <integer>. + internal ManagedOnlineEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData, MachineLearningEndpointAuthMode? authMode, string compute, string description, IDictionary mirrorTraffic, Uri scoringUri, IDictionary traffic) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + AuthMode = authMode; + Compute = compute; + Description = description; + MirrorTraffic = mirrorTraffic; + ScoringUri = scoringUri; + Traffic = traffic; + EndpointType = endpointType; + } + + /// Enum to determine endpoint authentication mode. + public MachineLearningEndpointAuthMode? AuthMode { get; set; } + /// Gets or sets the compute. + public string Compute { get; set; } + /// Gets or sets the description. + public string Description { get; set; } + /// Dictionary of <integer>. + public IDictionary MirrorTraffic { get; } + /// Gets or sets the scoring uri. + public Uri ScoringUri { get; set; } + /// Dictionary of <integer>. + public IDictionary Traffic { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs new file mode 100644 index 0000000000000..bef855e02febb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedPERequirement. + public readonly partial struct ManagedPERequirement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPERequirement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequiredValue = "Required"; + private const string NotRequiredValue = "NotRequired"; + private const string NotApplicableValue = "NotApplicable"; + + /// Required. + public static ManagedPERequirement Required { get; } = new ManagedPERequirement(RequiredValue); + /// NotRequired. + public static ManagedPERequirement NotRequired { get; } = new ManagedPERequirement(NotRequiredValue); + /// NotApplicable. + public static ManagedPERequirement NotApplicable { get; } = new ManagedPERequirement(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPERequirement left, ManagedPERequirement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPERequirement left, ManagedPERequirement right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPERequirement(string value) => new ManagedPERequirement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPERequirement other && Equals(other); + /// + public bool Equals(ManagedPERequirement other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs new file mode 100644 index 0000000000000..0f093ab17e784 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedPEStatus. + public readonly partial struct ManagedPEStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPEStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InactiveValue = "Inactive"; + private const string ActiveValue = "Active"; + private const string NotApplicableValue = "NotApplicable"; + + /// Inactive. + public static ManagedPEStatus Inactive { get; } = new ManagedPEStatus(InactiveValue); + /// Active. + public static ManagedPEStatus Active { get; } = new ManagedPEStatus(ActiveValue); + /// NotApplicable. + public static ManagedPEStatus NotApplicable { get; } = new ManagedPEStatus(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPEStatus left, ManagedPEStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPEStatus left, ManagedPEStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPEStatus(string value) => new ManagedPEStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPEStatus other && Equals(other); + /// + public bool Equals(ManagedPEStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs index 319bc38d8b8a6..dca7b304c2e6d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GenerationSafetyQualityMetricThreshold.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs @@ -13,32 +13,23 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class GenerationSafetyQualityMetricThreshold : IUtf8JsonSerializable, IJsonModel + public partial class ManagedResourceGroupAssignedIdentities : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - if (Optional.IsDefined(Threshold)) + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -58,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteEndObject(); } - GenerationSafetyQualityMetricThreshold IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagedResourceGroupAssignedIdentities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGenerationSafetyQualityMetricThreshold(document.RootElement, options); + return DeserializeManagedResourceGroupAssignedIdentities(document.RootElement, options); } - internal static GenerationSafetyQualityMetricThreshold DeserializeGenerationSafetyQualityMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagedResourceGroupAssignedIdentities DeserializeManagedResourceGroupAssignedIdentities(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +69,18 @@ internal static GenerationSafetyQualityMetricThreshold DeserializeGenerationSafe { return null; } - GenerationSafetyQualityMetric metric = default; - MonitoringThreshold threshold = default; + Guid? principalId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("metric"u8)) - { - metric = new GenerationSafetyQualityMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) + if (property.NameEquals("principalId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - threshold = null; continue; } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); + principalId = property.Value.GetGuid(); continue; } if (options.Format != "W") @@ -105,38 +89,38 @@ internal static GenerationSafetyQualityMetricThreshold DeserializeGenerationSafe } } serializedAdditionalRawData = rawDataDictionary; - return new GenerationSafetyQualityMetricThreshold(metric, threshold, serializedAdditionalRawData); + return new ManagedResourceGroupAssignedIdentities(principalId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support writing '{options.Format}' format."); } } - GenerationSafetyQualityMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagedResourceGroupAssignedIdentities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGenerationSafetyQualityMetricThreshold(document.RootElement, options); + return DeserializeManagedResourceGroupAssignedIdentities(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GenerationSafetyQualityMetricThreshold)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs similarity index 69% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs index 3b97a28d24e30..1fd6356f43f09 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Model configuration options. - public partial class ModelConfiguration + /// Details for managed resource group assigned identities. + public partial class ManagedResourceGroupAssignedIdentities { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,21 @@ public partial class ModelConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ModelConfiguration() + /// Initializes a new instance of . + public ManagedResourceGroupAssignedIdentities() { } - /// Initializes a new instance of . - /// Input delivery mode for the model. - /// Relative mounting path of the model in the target image. + /// Initializes a new instance of . + /// Identity principal Id. /// Keeps track of any properties unknown to the library. - internal ModelConfiguration(PackageInputDeliveryMode? mode, string mountPath, IDictionary serializedAdditionalRawData) + internal ManagedResourceGroupAssignedIdentities(Guid? principalId, IDictionary serializedAdditionalRawData) { - Mode = mode; - MountPath = mountPath; + PrincipalId = principalId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Input delivery mode for the model. - public PackageInputDeliveryMode? Mode { get; set; } - /// Relative mounting path of the model in the target image. - public string MountPath { get; set; } + /// Identity principal Id. + public Guid? PrincipalId { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs new file mode 100644 index 0000000000000..e5329dc0a8988 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ManagedResourceGroupSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AssignedIdentities)) + { + if (AssignedIdentities != null) + { + writer.WritePropertyName("assignedIdentities"u8); + writer.WriteStartArray(); + foreach (var item in AssignedIdentities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("assignedIdentities"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedResourceGroupSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedResourceGroupSettings(document.RootElement, options); + } + + internal static ManagedResourceGroupSettings DeserializeManagedResourceGroupSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + assignedIdentities = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedResourceGroupAssignedIdentities.DeserializeManagedResourceGroupAssignedIdentities(item, options)); + } + assignedIdentities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedResourceGroupSettings(assignedIdentities ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support writing '{options.Format}' format."); + } + } + + ManagedResourceGroupSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedResourceGroupSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs similarity index 68% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs index 427462ba78951..1bc7eb5ea3c0c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// The MonitoringDataSegment. - public partial class MonitoringDataSegment + /// Managed resource group settings. + internal partial class ManagedResourceGroupSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ public partial class MonitoringDataSegment /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MonitoringDataSegment() + /// Initializes a new instance of . + public ManagedResourceGroupSettings() { - Values = new ChangeTrackingList(); + AssignedIdentities = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The feature to segment the data on. - /// Filters for only the specified values of the given segmented feature. + /// Initializes a new instance of . + /// List of assigned identities for the managed resource group. /// Keeps track of any properties unknown to the library. - internal MonitoringDataSegment(string feature, IList values, IDictionary serializedAdditionalRawData) + internal ManagedResourceGroupSettings(IList assignedIdentities, IDictionary serializedAdditionalRawData) { - Feature = feature; - Values = values; + AssignedIdentities = assignedIdentities; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The feature to segment the data on. - public string Feature { get; set; } - /// Filters for only the specified values of the given segmented feature. - public IList Values { get; set; } + /// List of assigned identities for the managed resource group. + public IList AssignedIdentities { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs similarity index 50% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs index 422d4d91cd12b..d671d47cef500 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelClass.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs @@ -13,47 +13,53 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelClass : IUtf8JsonSerializable, IJsonModel + public partial class MarketplacePlan : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelClass)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(DisplayName)) + if (options.Format != "W" && Optional.IsDefined(OfferId)) { - if (DisplayName != null) + if (OfferId != null) { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); } else { - writer.WriteNull("displayName"); + writer.WriteNull("offerId"); } } - if (Optional.IsCollectionDefined(Subclasses)) + if (options.Format != "W" && Optional.IsDefined(PlanId)) { - if (Subclasses != null) + if (PlanId != null) { - writer.WritePropertyName("subclasses"u8); - writer.WriteStartObject(); - foreach (var item in Subclasses) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + } + else + { + writer.WriteNull("planId"); + } + } + if (options.Format != "W" && Optional.IsDefined(PublisherId)) + { + if (PublisherId != null) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); } else { - writer.WriteNull("subclasses"); + writer.WriteNull("publisherId"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -74,19 +80,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption writer.WriteEndObject(); } - LabelClass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MarketplacePlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelClass)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelClass(document.RootElement, options); + return DeserializeMarketplacePlan(document.RootElement, options); } - internal static LabelClass DeserializeLabelClass(JsonElement element, ModelReaderWriterOptions options = null) + internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -94,35 +100,41 @@ internal static LabelClass DeserializeLabelClass(JsonElement element, ModelReade { return null; } - string displayName = default; - IDictionary subclasses = default; + string offerId = default; + string planId = default; + string publisherId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("displayName"u8)) + if (property.NameEquals("offerId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - displayName = null; + offerId = null; continue; } - displayName = property.Value.GetString(); + offerId = property.Value.GetString(); continue; } - if (property.NameEquals("subclasses"u8)) + if (property.NameEquals("planId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - subclasses = null; + planId = null; continue; } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + planId = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, DeserializeLabelClass(property0.Value, options)); + publisherId = null; + continue; } - subclasses = dictionary; + publisherId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -131,38 +143,38 @@ internal static LabelClass DeserializeLabelClass(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new LabelClass(displayName, subclasses ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new MarketplacePlan(offerId, planId, publisherId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelClass)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{options.Format}' format."); } } - LabelClass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MarketplacePlan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelClass(document.RootElement, options); + return DeserializeMarketplacePlan(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelClass)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs index ae6b6681bdc14..803ecbcd277f4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssistConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs @@ -10,12 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// - /// Labeling MLAssist configuration definition - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class MachineLearningAssistConfiguration + /// The MarketplacePlan. + public partial class MarketplacePlan { /// /// Keeps track of any properties unknown to the library. @@ -47,23 +43,31 @@ public abstract partial class MachineLearningAssistConfiguration /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected MachineLearningAssistConfiguration() + /// Initializes a new instance of . + internal MarketplacePlan() { } - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. + /// Initializes a new instance of . + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. /// Keeps track of any properties unknown to the library. - internal MachineLearningAssistConfiguration(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData) + internal MarketplacePlan(string offerId, string planId, string publisherId, IDictionary serializedAdditionalRawData) { - MlAssist = mlAssist; + OfferId = offerId; + PlanId = planId; + PublisherId = publisherId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// [Required] Indicates whether MLAssist feature is enabled. - internal MLAssistConfigurationType MlAssist { get; set; } + /// The identifying name of the Offer of the Marketplace Plan. + public string OfferId { get; } + /// The identifying name of the Plan of the Marketplace Plan. + public string PlanId { get; } + /// The identifying name of the Publisher of the Marketplace Plan. + public string PublisherId { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs new file mode 100644 index 0000000000000..605767c0f678c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class MarketplaceSubscriptionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(MarketplacePlan)) + { + if (MarketplacePlan != null) + { + writer.WritePropertyName("marketplacePlan"u8); + writer.WriteObjectValue(MarketplacePlan, options); + } + else + { + writer.WriteNull("marketplacePlan"); + } + } + if (options.Format != "W" && Optional.IsDefined(MarketplaceSubscriptionStatus)) + { + writer.WritePropertyName("marketplaceSubscriptionStatus"u8); + writer.WriteStringValue(MarketplaceSubscriptionStatus.Value.ToString()); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MarketplaceSubscriptionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceSubscriptionProperties(document.RootElement, options); + } + + internal static MarketplaceSubscriptionProperties DeserializeMarketplaceSubscriptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MarketplacePlan marketplacePlan = default; + MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default; + string modelId = default; + MarketplaceSubscriptionProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("marketplacePlan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + marketplacePlan = null; + continue; + } + marketplacePlan = MarketplacePlan.DeserializeMarketplacePlan(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceSubscriptionStatus = new MarketplaceSubscriptionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MarketplaceSubscriptionProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceSubscriptionProperties(marketplacePlan, marketplaceSubscriptionStatus, modelId, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceSubscriptionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMarketplaceSubscriptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceSubscriptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs new file mode 100644 index 0000000000000..a952a9759fcee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MarketplaceSubscriptionProperties. + public partial class MarketplaceSubscriptionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// is null. + public MarketplaceSubscriptionProperties(string modelId) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; + } + + /// Initializes a new instance of . + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Provisioning State of the Marketplace Subscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSubscriptionProperties(MarketplacePlan marketplacePlan, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string modelId, MarketplaceSubscriptionProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + MarketplacePlan = marketplacePlan; + MarketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + ModelId = modelId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MarketplaceSubscriptionProperties() + { + } + + /// Marketplace Plan associated with the Marketplace Subscription. + public MarketplacePlan MarketplacePlan { get; } + /// Current status of the Marketplace Subscription. + public MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + public string ModelId { get; set; } + /// Provisioning State of the Marketplace Subscription. + public MarketplaceSubscriptionProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.cs new file mode 100644 index 0000000000000..11d5e61b8264d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MarketplaceSubscriptionProvisioningState. + public readonly partial struct MarketplaceSubscriptionProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarketplaceSubscriptionProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string UpdatingValue = "Updating"; + private const string CanceledValue = "Canceled"; + + /// MarketplaceSubscription is being created. + public static MarketplaceSubscriptionProvisioningState Creating { get; } = new MarketplaceSubscriptionProvisioningState(CreatingValue); + /// MarketplaceSubscription is being deleted. + public static MarketplaceSubscriptionProvisioningState Deleting { get; } = new MarketplaceSubscriptionProvisioningState(DeletingValue); + /// MarketplaceSubscription is successfully provisioned. + public static MarketplaceSubscriptionProvisioningState Succeeded { get; } = new MarketplaceSubscriptionProvisioningState(SucceededValue); + /// MarketplaceSubscription provisioning failed. + public static MarketplaceSubscriptionProvisioningState Failed { get; } = new MarketplaceSubscriptionProvisioningState(FailedValue); + /// MarketplaceSubscription is being updated. + public static MarketplaceSubscriptionProvisioningState Updating { get; } = new MarketplaceSubscriptionProvisioningState(UpdatingValue); + /// Canceled. + public static MarketplaceSubscriptionProvisioningState Canceled { get; } = new MarketplaceSubscriptionProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(MarketplaceSubscriptionProvisioningState left, MarketplaceSubscriptionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarketplaceSubscriptionProvisioningState left, MarketplaceSubscriptionProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MarketplaceSubscriptionProvisioningState(string value) => new MarketplaceSubscriptionProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarketplaceSubscriptionProvisioningState other && Equals(other); + /// + public bool Equals(MarketplaceSubscriptionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs similarity index 58% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs index 15907f39a48d8..14a5efb3f6ae9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class LabelingJobResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + internal partial class MarketplaceSubscriptionResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteEndObject(); } - LabelingJobResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MarketplaceSubscriptionResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement, options); + return DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement, options); } - internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static MarketplaceSubscriptionResourceArmPaginatedResult DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -80,7 +80,7 @@ internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobReso return null; } string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,10 +96,10 @@ internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobReso { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(item, options)); + array.Add(MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(item, options)); } value = array; continue; @@ -110,38 +110,38 @@ internal static LabelingJobResourceArmPaginatedResult DeserializeLabelingJobReso } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new MarketplaceSubscriptionResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); } } - LabelingJobResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MarketplaceSubscriptionResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement, options); + return DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MarketplaceSubscriptionResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..02e7b285f352d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// A paginated list of MarketplaceSubscription entities. + internal partial class MarketplaceSubscriptionResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MarketplaceSubscriptionResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + /// An array of objects of type MarketplaceSubscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSubscriptionResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + public string NextLink { get; } + /// An array of objects of type MarketplaceSubscription. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs new file mode 100644 index 0000000000000..58a3644401738 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionStatus.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MarketplaceSubscriptionStatus. + public readonly partial struct MarketplaceSubscriptionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarketplaceSubscriptionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SubscribedValue = "Subscribed"; + private const string SuspendedValue = "Suspended"; + private const string UnsubscribedValue = "Unsubscribed"; + + /// + /// The customer can now use the Marketplace Subscription's + /// model and will be billed. + /// + public static MarketplaceSubscriptionStatus Subscribed { get; } = new MarketplaceSubscriptionStatus(SubscribedValue); + /// + /// The customer could not be billed for the Marketplace Subscription. + /// The customer will not be able to access the model. + /// + public static MarketplaceSubscriptionStatus Suspended { get; } = new MarketplaceSubscriptionStatus(SuspendedValue); + /// + /// Marketplace Subscriptions reach this state in response to an explicit customer or CSP action. + /// A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, + /// after being in the Suspended state for some time. + /// + public static MarketplaceSubscriptionStatus Unsubscribed { get; } = new MarketplaceSubscriptionStatus(UnsubscribedValue); + /// Determines if two values are the same. + public static bool operator ==(MarketplaceSubscriptionStatus left, MarketplaceSubscriptionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarketplaceSubscriptionStatus left, MarketplaceSubscriptionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MarketplaceSubscriptionStatus(string value) => new MarketplaceSubscriptionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarketplaceSubscriptionStatus other && Equals(other); + /// + public bool Equals(MarketplaceSubscriptionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs index 433ff76d12017..a76bb655e0c75 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MaterializationComputeResource.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Dto object representing compute resource. + /// DTO object representing compute resource. internal partial class MaterializationComputeResource { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs new file mode 100644 index 0000000000000..0b6a4651ccac4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Model lifecycle status. + public readonly partial struct ModelLifecycleStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModelLifecycleStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GenerallyAvailableValue = "GenerallyAvailable"; + private const string PreviewValue = "Preview"; + + /// GenerallyAvailable. + public static ModelLifecycleStatus GenerallyAvailable { get; } = new ModelLifecycleStatus(GenerallyAvailableValue); + /// Preview. + public static ModelLifecycleStatus Preview { get; } = new ModelLifecycleStatus(PreviewValue); + /// Determines if two values are the same. + public static bool operator ==(ModelLifecycleStatus left, ModelLifecycleStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModelLifecycleStatus left, ModelLifecycleStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModelLifecycleStatus(string value) => new ModelLifecycleStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModelLifecycleStatus other && Equals(other); + /// + public bool Equals(ModelLifecycleStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs deleted file mode 100644 index 8fc503433c34a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.Serialization.cs +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPackageContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(BaseEnvironmentSource)) - { - if (BaseEnvironmentSource != null) - { - writer.WritePropertyName("baseEnvironmentSource"u8); - writer.WriteObjectValue(BaseEnvironmentSource, options); - } - else - { - writer.WriteNull("baseEnvironmentSource"); - } - } - if (Optional.IsCollectionDefined(EnvironmentVariables)) - { - if (EnvironmentVariables != null) - { - writer.WritePropertyName("environmentVariables"u8); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("environmentVariables"); - } - } - writer.WritePropertyName("inferencingServer"u8); - writer.WriteObjectValue(InferencingServer, options); - if (Optional.IsCollectionDefined(Inputs)) - { - if (Inputs != null) - { - writer.WritePropertyName("inputs"u8); - writer.WriteStartArray(); - foreach (var item in Inputs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("inputs"); - } - } - if (Optional.IsDefined(ModelConfiguration)) - { - if (ModelConfiguration != null) - { - writer.WritePropertyName("modelConfiguration"u8); - writer.WriteObjectValue(ModelConfiguration, options); - } - else - { - writer.WriteNull("modelConfiguration"); - } - } - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - writer.WritePropertyName("targetEnvironmentId"u8); - writer.WriteStringValue(TargetEnvironmentId); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPackageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPackageContent(document.RootElement, options); - } - - internal static ModelPackageContent DeserializeModelPackageContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - BaseEnvironmentSource baseEnvironmentSource = default; - IDictionary environmentVariables = default; - InferencingServer inferencingServer = default; - IList inputs = default; - ModelConfiguration modelConfiguration = default; - IDictionary tags = default; - string targetEnvironmentId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("baseEnvironmentSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - baseEnvironmentSource = null; - continue; - } - baseEnvironmentSource = BaseEnvironmentSource.DeserializeBaseEnvironmentSource(property.Value, options); - continue; - } - if (property.NameEquals("environmentVariables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - environmentVariables = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property.NameEquals("inferencingServer"u8)) - { - inferencingServer = InferencingServer.DeserializeInferencingServer(property.Value, options); - continue; - } - if (property.NameEquals("inputs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inputs = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ModelPackageInput.DeserializeModelPackageInput(item, options)); - } - inputs = array; - continue; - } - if (property.NameEquals("modelConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelConfiguration = null; - continue; - } - modelConfiguration = ModelConfiguration.DeserializeModelConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("targetEnvironmentId"u8)) - { - targetEnvironmentId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPackageContent( - baseEnvironmentSource, - environmentVariables ?? new ChangeTrackingDictionary(), - inferencingServer, - inputs ?? new ChangeTrackingList(), - modelConfiguration, - tags ?? new ChangeTrackingDictionary(), - targetEnvironmentId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support writing '{options.Format}' format."); - } - } - - ModelPackageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPackageContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPackageContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs deleted file mode 100644 index d8884a1703fcd..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageContent.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model package operation request properties. - public partial class ModelPackageContent - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// [Required] Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// [Required] Arm ID of the target environment to be created by package operation. - /// or is null. - public ModelPackageContent(InferencingServer inferencingServer, string targetEnvironmentId) - { - Argument.AssertNotNull(inferencingServer, nameof(inferencingServer)); - Argument.AssertNotNull(targetEnvironmentId, nameof(targetEnvironmentId)); - - EnvironmentVariables = new ChangeTrackingDictionary(); - InferencingServer = inferencingServer; - Inputs = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - TargetEnvironmentId = targetEnvironmentId; - } - - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Collection of environment variables. - /// - /// [Required] Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// Collection of inputs. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// [Required] Arm ID of the target environment to be created by package operation. - /// Keeps track of any properties unknown to the library. - internal ModelPackageContent(BaseEnvironmentSource baseEnvironmentSource, IDictionary environmentVariables, InferencingServer inferencingServer, IList inputs, ModelConfiguration modelConfiguration, IDictionary tags, string targetEnvironmentId, IDictionary serializedAdditionalRawData) - { - BaseEnvironmentSource = baseEnvironmentSource; - EnvironmentVariables = environmentVariables; - InferencingServer = inferencingServer; - Inputs = inputs; - ModelConfiguration = modelConfiguration; - Tags = tags; - TargetEnvironmentId = targetEnvironmentId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ModelPackageContent() - { - } - - /// - /// Base environment to start with. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public BaseEnvironmentSource BaseEnvironmentSource { get; set; } - /// Collection of environment variables. - public IDictionary EnvironmentVariables { get; set; } - /// - /// [Required] Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public InferencingServer InferencingServer { get; } - /// Collection of inputs. - public IList Inputs { get; set; } - /// Model configuration including the mount mode. - public ModelConfiguration ModelConfiguration { get; set; } - /// Tag dictionary. Tags can be added, removed, and updated. - public IDictionary Tags { get; set; } - /// [Required] Arm ID of the target environment to be created by package operation. - public string TargetEnvironmentId { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs deleted file mode 100644 index da416eee27148..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.Serialization.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPackageInput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("inputType"u8); - writer.WriteStringValue(InputType.ToString()); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(MountPath)) - { - if (MountPath != null) - { - writer.WritePropertyName("mountPath"u8); - writer.WriteStringValue(MountPath); - } - else - { - writer.WriteNull("mountPath"); - } - } - writer.WritePropertyName("path"u8); - writer.WriteObjectValue(Path, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPackageInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPackageInput(document.RootElement, options); - } - - internal static ModelPackageInput DeserializeModelPackageInput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - PackageInputType inputType = default; - PackageInputDeliveryMode? mode = default; - string mountPath = default; - PackageInputPathBase path = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inputType"u8)) - { - inputType = new PackageInputType(property.Value.GetString()); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new PackageInputDeliveryMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("mountPath"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - mountPath = null; - continue; - } - mountPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("path"u8)) - { - path = PackageInputPathBase.DeserializePackageInputPathBase(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPackageInput(inputType, mode, mountPath, path, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support writing '{options.Format}' format."); - } - } - - ModelPackageInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPackageInput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPackageInput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs deleted file mode 100644 index f39a4fd39a8fa..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageInput.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model package input options. - public partial class ModelPackageInput - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// [Required] Type of the input included in the target image. - /// - /// [Required] Location of the input. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// is null. - public ModelPackageInput(PackageInputType inputType, PackageInputPathBase path) - { - Argument.AssertNotNull(path, nameof(path)); - - InputType = inputType; - Path = path; - } - - /// Initializes a new instance of . - /// [Required] Type of the input included in the target image. - /// Input delivery mode of the input. - /// Relative mount path of the input in the target image. - /// - /// [Required] Location of the input. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Keeps track of any properties unknown to the library. - internal ModelPackageInput(PackageInputType inputType, PackageInputDeliveryMode? mode, string mountPath, PackageInputPathBase path, IDictionary serializedAdditionalRawData) - { - InputType = inputType; - Mode = mode; - MountPath = mountPath; - Path = path; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ModelPackageInput() - { - } - - /// [Required] Type of the input included in the target image. - public PackageInputType InputType { get; set; } - /// Input delivery mode of the input. - public PackageInputDeliveryMode? Mode { get; set; } - /// Relative mount path of the input in the target image. - public string MountPath { get; set; } - /// - /// [Required] Location of the input. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public PackageInputPathBase Path { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs deleted file mode 100644 index 7f91f0936ae36..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.Serialization.cs +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPackageResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(BaseEnvironmentSource)) - { - if (BaseEnvironmentSource != null) - { - writer.WritePropertyName("baseEnvironmentSource"u8); - writer.WriteObjectValue(BaseEnvironmentSource, options); - } - else - { - writer.WriteNull("baseEnvironmentSource"); - } - } - if (options.Format != "W" && Optional.IsDefined(BuildId)) - { - if (BuildId != null) - { - writer.WritePropertyName("buildId"u8); - writer.WriteStringValue(BuildId); - } - else - { - writer.WriteNull("buildId"); - } - } - if (options.Format != "W" && Optional.IsDefined(BuildState)) - { - writer.WritePropertyName("buildState"u8); - writer.WriteStringValue(BuildState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(EnvironmentVariables)) - { - if (EnvironmentVariables != null) - { - writer.WritePropertyName("environmentVariables"u8); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("environmentVariables"); - } - } - if (options.Format != "W" && Optional.IsDefined(InferencingServer)) - { - if (InferencingServer != null) - { - writer.WritePropertyName("inferencingServer"u8); - writer.WriteObjectValue(InferencingServer, options); - } - else - { - writer.WriteNull("inferencingServer"); - } - } - if (options.Format != "W" && Optional.IsCollectionDefined(Inputs)) - { - if (Inputs != null) - { - writer.WritePropertyName("inputs"u8); - writer.WriteStartArray(); - foreach (var item in Inputs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("inputs"); - } - } - if (options.Format != "W" && Optional.IsDefined(LogUri)) - { - if (LogUri != null) - { - writer.WritePropertyName("logUrl"u8); - writer.WriteStringValue(LogUri.AbsoluteUri); - } - else - { - writer.WriteNull("logUrl"); - } - } - if (options.Format != "W" && Optional.IsDefined(ModelConfiguration)) - { - if (ModelConfiguration != null) - { - writer.WritePropertyName("modelConfiguration"u8); - writer.WriteObjectValue(ModelConfiguration, options); - } - else - { - writer.WriteNull("modelConfiguration"); - } - } - if (options.Format != "W" && Optional.IsCollectionDefined(Tags)) - { - if (Tags != null) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("tags"); - } - } - if (options.Format != "W" && Optional.IsDefined(TargetEnvironmentId)) - { - if (TargetEnvironmentId != null) - { - writer.WritePropertyName("targetEnvironmentId"u8); - writer.WriteStringValue(TargetEnvironmentId); - } - else - { - writer.WriteNull("targetEnvironmentId"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPackageResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPackageResult(document.RootElement, options); - } - - internal static ModelPackageResult DeserializeModelPackageResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - BaseEnvironmentSource baseEnvironmentSource = default; - string buildId = default; - PackageBuildState? buildState = default; - IReadOnlyDictionary environmentVariables = default; - InferencingServer inferencingServer = default; - IReadOnlyList inputs = default; - Uri logUrl = default; - ModelConfiguration modelConfiguration = default; - IReadOnlyDictionary tags = default; - string targetEnvironmentId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("baseEnvironmentSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - baseEnvironmentSource = null; - continue; - } - baseEnvironmentSource = BaseEnvironmentSource.DeserializeBaseEnvironmentSource(property.Value, options); - continue; - } - if (property.NameEquals("buildId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - buildId = null; - continue; - } - buildId = property.Value.GetString(); - continue; - } - if (property.NameEquals("buildState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - buildState = new PackageBuildState(property.Value.GetString()); - continue; - } - if (property.NameEquals("environmentVariables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - environmentVariables = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property.NameEquals("inferencingServer"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inferencingServer = null; - continue; - } - inferencingServer = InferencingServer.DeserializeInferencingServer(property.Value, options); - continue; - } - if (property.NameEquals("inputs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inputs = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ModelPackageInput.DeserializeModelPackageInput(item, options)); - } - inputs = array; - continue; - } - if (property.NameEquals("logUrl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - logUrl = null; - continue; - } - logUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelConfiguration = null; - continue; - } - modelConfiguration = ModelConfiguration.DeserializeModelConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - tags = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("targetEnvironmentId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - targetEnvironmentId = null; - continue; - } - targetEnvironmentId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPackageResult( - baseEnvironmentSource, - buildId, - buildState, - environmentVariables ?? new ChangeTrackingDictionary(), - inferencingServer, - inputs ?? new ChangeTrackingList(), - logUrl, - modelConfiguration, - tags ?? new ChangeTrackingDictionary(), - targetEnvironmentId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support writing '{options.Format}' format."); - } - } - - ModelPackageResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPackageResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPackageResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs deleted file mode 100644 index 627e1ee30296f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPackageResult.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package response returned after async package operation completes successfully. - public partial class ModelPackageResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ModelPackageResult() - { - EnvironmentVariables = new ChangeTrackingDictionary(); - Inputs = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// - /// Base environment to start with. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Build id of the image build operation. - /// Build state of the image build operation. - /// Collection of environment variables. - /// - /// Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// Collection of inputs. - /// Log url of the image build operation. - /// Model configuration including the mount mode. - /// Tag dictionary. Tags can be added, removed, and updated. - /// Asset ID of the target environment created by package operation. - /// Keeps track of any properties unknown to the library. - internal ModelPackageResult(BaseEnvironmentSource baseEnvironmentSource, string buildId, PackageBuildState? buildState, IReadOnlyDictionary environmentVariables, InferencingServer inferencingServer, IReadOnlyList inputs, Uri logUri, ModelConfiguration modelConfiguration, IReadOnlyDictionary tags, string targetEnvironmentId, IDictionary serializedAdditionalRawData) - { - BaseEnvironmentSource = baseEnvironmentSource; - BuildId = buildId; - BuildState = buildState; - EnvironmentVariables = environmentVariables; - InferencingServer = inferencingServer; - Inputs = inputs; - LogUri = logUri; - ModelConfiguration = modelConfiguration; - Tags = tags; - TargetEnvironmentId = targetEnvironmentId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// Base environment to start with. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public BaseEnvironmentSource BaseEnvironmentSource { get; } - /// Build id of the image build operation. - public string BuildId { get; } - /// Build state of the image build operation. - public PackageBuildState? BuildState { get; } - /// Collection of environment variables. - public IReadOnlyDictionary EnvironmentVariables { get; } - /// - /// Inferencing server configurations. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public InferencingServer InferencingServer { get; } - /// Collection of inputs. - public IReadOnlyList Inputs { get; } - /// Log url of the image build operation. - public Uri LogUri { get; } - /// Model configuration including the mount mode. - public ModelConfiguration ModelConfiguration { get; } - /// Tag dictionary. Tags can be added, removed, and updated. - public IReadOnlyDictionary Tags { get; } - /// Asset ID of the target environment created by package operation. - public string TargetEnvironmentId { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs deleted file mode 100644 index 899e18214637a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.Serialization.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownModelPerformanceMetricThresholdBase))] - public partial class ModelPerformanceMetricThresholdBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPerformanceMetricThresholdBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); - } - - internal static ModelPerformanceMetricThresholdBase DeserializeModelPerformanceMetricThresholdBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("modelType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Classification": return ClassificationModelPerformanceMetricThreshold.DeserializeClassificationModelPerformanceMetricThreshold(element, options); - case "Regression": return RegressionModelPerformanceMetricThreshold.DeserializeRegressionModelPerformanceMetricThreshold(element, options); - } - } - return UnknownModelPerformanceMetricThresholdBase.DeserializeUnknownModelPerformanceMetricThresholdBase(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{options.Format}' format."); - } - } - - ModelPerformanceMetricThresholdBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs deleted file mode 100644 index ee8c9a375a809..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceMetricThresholdBase.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class ModelPerformanceMetricThresholdBase - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected ModelPerformanceMetricThresholdBase() - { - } - - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - internal ModelPerformanceMetricThresholdBase(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) - { - ModelType = modelType; - Threshold = threshold; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Specifies the data type of the metric threshold. - internal MonitoringModelType ModelType { get; set; } - /// The threshold value. If null, a default value will be set depending on the selected metric. - internal MonitoringThreshold Threshold { get; set; } - /// The threshold value. If null, the set default is dependent on the metric type. - public double? ThresholdValue - { - get => Threshold is null ? default : Threshold.Value; - set - { - if (Threshold is null) - Threshold = new MonitoringThreshold(); - Threshold.Value = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs deleted file mode 100644 index a30e982ae321d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.Serialization.cs +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ModelPerformanceSignal : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(DataSegment)) - { - if (DataSegment != null) - { - writer.WritePropertyName("dataSegment"u8); - writer.WriteObjectValue(DataSegment, options); - } - else - { - writer.WriteNull("dataSegment"); - } - } - writer.WritePropertyName("metricThreshold"u8); - writer.WriteObjectValue(MetricThreshold, options); - writer.WritePropertyName("productionData"u8); - writer.WriteStartArray(); - foreach (var item in ProductionData) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WritePropertyName("referenceData"u8); - writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsCollectionDefined(Properties)) - { - if (Properties != null) - { - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("properties"); - } - } - writer.WritePropertyName("signalType"u8); - writer.WriteStringValue(SignalType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelPerformanceSignal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPerformanceSignal(document.RootElement, options); - } - - internal static ModelPerformanceSignal DeserializeModelPerformanceSignal(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MonitoringDataSegment dataSegment = default; - ModelPerformanceMetricThresholdBase metricThreshold = default; - IList productionData = default; - MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; - IDictionary properties = default; - MonitoringSignalType signalType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("dataSegment"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - dataSegment = null; - continue; - } - dataSegment = MonitoringDataSegment.DeserializeMonitoringDataSegment(property.Value, options); - continue; - } - if (property.NameEquals("metricThreshold"u8)) - { - metricThreshold = ModelPerformanceMetricThresholdBase.DeserializeModelPerformanceMetricThresholdBase(property.Value, options); - continue; - } - if (property.NameEquals("productionData"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MonitoringInputDataBase.DeserializeMonitoringInputDataBase(item, options)); - } - productionData = array; - continue; - } - if (property.NameEquals("referenceData"u8)) - { - referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new MonitoringNotificationMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - properties = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("signalType"u8)) - { - signalType = new MonitoringSignalType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelPerformanceSignal( - mode, - properties ?? new ChangeTrackingDictionary(), - signalType, - serializedAdditionalRawData, - dataSegment, - metricThreshold, - productionData, - referenceData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support writing '{options.Format}' format."); - } - } - - ModelPerformanceSignal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPerformanceSignal(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelPerformanceSignal)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs deleted file mode 100644 index 46931be82aa82..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelPerformanceSignal.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model performance signal definition. - public partial class ModelPerformanceSignal : MonitoringSignalBase - { - /// Initializes a new instance of . - /// - /// [Required] A list of metrics to calculate and their associated thresholds. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// - /// [Required] The data produced by the production service which drift will be calculated for. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// - /// [Required] The data to calculate drift against. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// , or is null. - public ModelPerformanceSignal(ModelPerformanceMetricThresholdBase metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) - { - Argument.AssertNotNull(metricThreshold, nameof(metricThreshold)); - Argument.AssertNotNull(productionData, nameof(productionData)); - Argument.AssertNotNull(referenceData, nameof(referenceData)); - - MetricThreshold = metricThreshold; - ProductionData = productionData.ToList(); - ReferenceData = referenceData; - SignalType = MonitoringSignalType.ModelPerformance; - } - - /// Initializes a new instance of . - /// The current notification mode for this signal. - /// Property dictionary. Properties can be added, but not removed or altered. - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - /// The data segment. - /// - /// [Required] A list of metrics to calculate and their associated thresholds. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// - /// [Required] The data produced by the production service which drift will be calculated for. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// - /// [Required] The data to calculate drift against. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - internal ModelPerformanceSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, MonitoringDataSegment dataSegment, ModelPerformanceMetricThresholdBase metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) - { - DataSegment = dataSegment; - MetricThreshold = metricThreshold; - ProductionData = productionData; - ReferenceData = referenceData; - SignalType = signalType; - } - - /// Initializes a new instance of for deserialization. - internal ModelPerformanceSignal() - { - } - - /// The data segment. - public MonitoringDataSegment DataSegment { get; set; } - /// - /// [Required] A list of metrics to calculate and their associated thresholds. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public ModelPerformanceMetricThresholdBase MetricThreshold { get; set; } - /// - /// [Required] The data produced by the production service which drift will be calculated for. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public IList ProductionData { get; } - /// - /// [Required] The data to calculate drift against. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public MonitoringInputDataBase ReferenceData { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs new file mode 100644 index 0000000000000..abfac75efe61b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to determine the type of fine tuning. + internal readonly partial struct ModelProvider : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModelProvider(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "AzureOpenAI"; + private const string CustomValue = "Custom"; + + /// Fine tuning using Azure Open AI model. + public static ModelProvider AzureOpenAI { get; } = new ModelProvider(AzureOpenAIValue); + /// Fine tuning using custom model. + public static ModelProvider Custom { get; } = new ModelProvider(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(ModelProvider left, ModelProvider right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModelProvider left, ModelProvider right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModelProvider(string value) => new ModelProvider(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModelProvider other && Equals(other); + /// + public bool Equals(ModelProvider other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs index 453e16c521945..00b70fc620c13 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobInstructions.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs @@ -13,29 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class LabelingJobInstructions : IUtf8JsonSerializable, IJsonModel + internal partial class ModelSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(ModelId)) { - if (Uri != null) + if (ModelId != null) { - writer.WritePropertyName("uri"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); } else { - writer.WriteNull("uri"); + writer.WriteNull("modelId"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -56,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - LabelingJobInstructions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobInstructions(document.RootElement, options); + return DeserializeModelSettings(document.RootElement, options); } - internal static LabelingJobInstructions DeserializeLabelingJobInstructions(JsonElement element, ModelReaderWriterOptions options = null) + internal static ModelSettings DeserializeModelSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,19 +76,19 @@ internal static LabelingJobInstructions DeserializeLabelingJobInstructions(JsonE { return null; } - Uri uri = default; + string modelId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("uri"u8)) + if (property.NameEquals("modelId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - uri = null; + modelId = null; continue; } - uri = new Uri(property.Value.GetString()); + modelId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +97,38 @@ internal static LabelingJobInstructions DeserializeLabelingJobInstructions(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobInstructions(uri, serializedAdditionalRawData); + return new ModelSettings(modelId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support writing '{options.Format}' format."); } } - LabelingJobInstructions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ModelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobInstructions(document.RootElement, options); + return DeserializeModelSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobInstructions)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ModelSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs new file mode 100644 index 0000000000000..8aca8bc654643 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ModelSettings. + internal partial class ModelSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ModelSettings() + { + } + + /// Initializes a new instance of . + /// The unique model identifier that this ServerlessEndpoint should provision. + /// Keeps track of any properties unknown to the library. + internal ModelSettings(string modelId, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The unique model identifier that this ServerlessEndpoint should provision. + public string ModelId { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs index 7185f0c325ec2..0eddb4a2d9806 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelTaskType.cs @@ -24,14 +24,11 @@ public ModelTaskType(string value) private const string ClassificationValue = "Classification"; private const string RegressionValue = "Regression"; - private const string QuestionAnsweringValue = "QuestionAnswering"; /// Classification. public static ModelTaskType Classification { get; } = new ModelTaskType(ClassificationValue); /// Regression. public static ModelTaskType Regression { get; } = new ModelTaskType(RegressionValue); - /// QuestionAnswering. - public static ModelTaskType QuestionAnswering { get; } = new ModelTaskType(QuestionAnsweringValue); /// Determines if two values are the same. public static bool operator ==(ModelTaskType left, ModelTaskType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs index 797cbdfe27268..6257f0012e663 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorComputeIdentityBase.cs @@ -55,7 +55,7 @@ protected MonitorComputeIdentityBase() } /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. internal MonitorComputeIdentityBase(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData) { @@ -63,7 +63,7 @@ internal MonitorComputeIdentityBase(MonitorComputeIdentityType computeIdentityTy _serializedAdditionalRawData = serializedAdditionalRawData; } - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. internal MonitorComputeIdentityType ComputeIdentityType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs index 8e12819d7e6f1..47e16cbcab878 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs @@ -26,16 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); - if (Optional.IsDefined(AlertNotificationSetting)) + if (Optional.IsDefined(AlertNotificationSettings)) { - if (AlertNotificationSetting != null) + if (AlertNotificationSettings != null) { - writer.WritePropertyName("alertNotificationSetting"u8); - writer.WriteObjectValue(AlertNotificationSetting, options); + writer.WritePropertyName("alertNotificationSettings"u8); + writer.WriteObjectValue(AlertNotificationSettings, options); } else { - writer.WriteNull("alertNotificationSetting"); + writer.WriteNull("alertNotificationSettings"); } } writer.WritePropertyName("computeConfiguration"u8); @@ -98,7 +98,7 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme { return null; } - MonitoringAlertNotificationSettingsBase alertNotificationSetting = default; + MonitorNotificationSettings alertNotificationSettings = default; MonitorComputeConfigurationBase computeConfiguration = default; MonitoringTarget monitoringTarget = default; IDictionary signals = default; @@ -106,14 +106,14 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("alertNotificationSetting"u8)) + if (property.NameEquals("alertNotificationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - alertNotificationSetting = null; + alertNotificationSettings = null; continue; } - alertNotificationSetting = MonitoringAlertNotificationSettingsBase.DeserializeMonitoringAlertNotificationSettingsBase(property.Value, options); + alertNotificationSettings = MonitorNotificationSettings.DeserializeMonitorNotificationSettings(property.Value, options); continue; } if (property.NameEquals("computeConfiguration"u8)) @@ -147,7 +147,7 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new MonitorDefinition(alertNotificationSetting, computeConfiguration, monitoringTarget, signals, serializedAdditionalRawData); + return new MonitorDefinition(alertNotificationSettings, computeConfiguration, monitoringTarget, signals, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs index 4a6ddba493ba6..a5950dac2b15e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs @@ -54,7 +54,7 @@ public partial class MonitorDefinition /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// /// or is null. public MonitorDefinition(MonitorComputeConfigurationBase computeConfiguration, IDictionary signals) @@ -67,26 +67,22 @@ public MonitorDefinition(MonitorComputeConfigurationBase computeConfiguration, I } /// Initializes a new instance of . - /// - /// The monitor's notification settings. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// + /// The monitor's notification settings. /// /// [Required] The ARM resource ID of the compute resource to run the monitoring job on. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - /// The ARM resource ID of either the model or deployment targeted by this monitor. + /// The entities targeted by the monitor. /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// /// Keeps track of any properties unknown to the library. - internal MonitorDefinition(MonitoringAlertNotificationSettingsBase alertNotificationSetting, MonitorComputeConfigurationBase computeConfiguration, MonitoringTarget monitoringTarget, IDictionary signals, IDictionary serializedAdditionalRawData) + internal MonitorDefinition(MonitorNotificationSettings alertNotificationSettings, MonitorComputeConfigurationBase computeConfiguration, MonitoringTarget monitoringTarget, IDictionary signals, IDictionary serializedAdditionalRawData) { - AlertNotificationSetting = alertNotificationSetting; + AlertNotificationSettings = alertNotificationSettings; ComputeConfiguration = computeConfiguration; MonitoringTarget = monitoringTarget; Signals = signals; @@ -98,24 +94,32 @@ internal MonitorDefinition() { } - /// - /// The monitor's notification settings. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public MonitoringAlertNotificationSettingsBase AlertNotificationSetting { get; set; } + /// The monitor's notification settings. + internal MonitorNotificationSettings AlertNotificationSettings { get; set; } + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails + { + get => AlertNotificationSettings is null ? default : AlertNotificationSettings.Emails; + set + { + if (AlertNotificationSettings is null) + AlertNotificationSettings = new MonitorNotificationSettings(); + AlertNotificationSettings.Emails = value; + } + } + /// /// [Required] The ARM resource ID of the compute resource to run the monitoring job on. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// public MonitorComputeConfigurationBase ComputeConfiguration { get; set; } - /// The ARM resource ID of either the model or deployment targeted by this monitor. + /// The entities targeted by the monitor. public MonitoringTarget MonitoringTarget { get; set; } /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// public IDictionary Signals { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs index 52b10ecf0e696..7e88982908cae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringDataSegment.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs @@ -13,38 +13,26 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MonitoringDataSegment : IUtf8JsonSerializable, IJsonModel + internal partial class MonitorEmailNotificationSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Feature)) + if (Optional.IsCollectionDefined(Emails)) { - if (Feature != null) + if (Emails != null) { - writer.WritePropertyName("feature"u8); - writer.WriteStringValue(Feature); - } - else - { - writer.WriteNull("feature"); - } - } - if (Optional.IsCollectionDefined(Values)) - { - if (Values != null) - { - writer.WritePropertyName("values"u8); + writer.WritePropertyName("emails"u8); writer.WriteStartArray(); - foreach (var item in Values) + foreach (var item in Emails) { writer.WriteStringValue(item); } @@ -52,7 +40,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } else { - writer.WriteNull("values"); + writer.WriteNull("emails"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -73,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - MonitoringDataSegment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MonitorEmailNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringDataSegment(document.RootElement, options); + return DeserializeMonitorEmailNotificationSettings(document.RootElement, options); } - internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonElement element, ModelReaderWriterOptions options = null) + internal static MonitorEmailNotificationSettings DeserializeMonitorEmailNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,27 +81,16 @@ internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonEleme { return null; } - string feature = default; - IList values = default; + IList emails = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("feature"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - feature = null; - continue; - } - feature = property.Value.GetString(); - continue; - } - if (property.NameEquals("values"u8)) + if (property.NameEquals("emails"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - values = null; + emails = null; continue; } List array = new List(); @@ -121,7 +98,7 @@ internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonEleme { array.Add(item.GetString()); } - values = array; + emails = array; continue; } if (options.Format != "W") @@ -130,38 +107,38 @@ internal static MonitoringDataSegment DeserializeMonitoringDataSegment(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoringDataSegment(feature, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new MonitorEmailNotificationSettings(emails ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support writing '{options.Format}' format."); } } - MonitoringDataSegment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MonitorEmailNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringDataSegment(document.RootElement, options); + return DeserializeMonitorEmailNotificationSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MonitoringDataSegment)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs new file mode 100644 index 0000000000000..4a748e4f6368b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MonitorEmailNotificationSettings. + internal partial class MonitorEmailNotificationSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MonitorEmailNotificationSettings() + { + Emails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The email recipient list which has a limitation of 499 characters in total. + /// Keeps track of any properties unknown to the library. + internal MonitorEmailNotificationSettings(IList emails, IDictionary serializedAdditionalRawData) + { + Emails = emails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs similarity index 53% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs index ec63bd3150029..76f1b9e5d4d94 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs @@ -13,34 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class ModelConfiguration : IUtf8JsonSerializable, IJsonModel + internal partial class MonitorNotificationSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) + if (Optional.IsDefined(EmailNotificationSettings)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(MountPath)) - { - if (MountPath != null) + if (EmailNotificationSettings != null) { - writer.WritePropertyName("mountPath"u8); - writer.WriteStringValue(MountPath); + writer.WritePropertyName("emailNotificationSettings"u8); + writer.WriteObjectValue(EmailNotificationSettings, options); } else { - writer.WriteNull("mountPath"); + writer.WriteNull("emailNotificationSettings"); } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -61,19 +56,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - ModelConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MonitorNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelConfiguration(document.RootElement, options); + return DeserializeMonitorNotificationSettings(document.RootElement, options); } - internal static ModelConfiguration DeserializeModelConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static MonitorNotificationSettings DeserializeMonitorNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,29 +76,19 @@ internal static ModelConfiguration DeserializeModelConfiguration(JsonElement ele { return null; } - PackageInputDeliveryMode? mode = default; - string mountPath = default; + MonitorEmailNotificationSettings emailNotificationSettings = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new PackageInputDeliveryMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("mountPath"u8)) + if (property.NameEquals("emailNotificationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - mountPath = null; + emailNotificationSettings = null; continue; } - mountPath = property.Value.GetString(); + emailNotificationSettings = MonitorEmailNotificationSettings.DeserializeMonitorEmailNotificationSettings(property.Value, options); continue; } if (options.Format != "W") @@ -112,38 +97,38 @@ internal static ModelConfiguration DeserializeModelConfiguration(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new ModelConfiguration(mode, mountPath, serializedAdditionalRawData); + return new MonitorNotificationSettings(emailNotificationSettings, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support writing '{options.Format}' format."); } } - ModelConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MonitorNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelConfiguration(document.RootElement, options); + return DeserializeMonitorNotificationSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ModelConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs index cd5b78d3729ce..abc1244c89eb2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs @@ -10,11 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class MonitoringAlertNotificationSettingsBase + /// The MonitorNotificationSettings. + internal partial class MonitorNotificationSettings { /// /// Keeps track of any properties unknown to the library. @@ -46,23 +43,34 @@ public abstract partial class MonitoringAlertNotificationSettingsBase /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected MonitoringAlertNotificationSettingsBase() + /// Initializes a new instance of . + public MonitorNotificationSettings() { } - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. + /// Initializes a new instance of . + /// The AML notification email settings. /// Keeps track of any properties unknown to the library. - internal MonitoringAlertNotificationSettingsBase(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData) + internal MonitorNotificationSettings(MonitorEmailNotificationSettings emailNotificationSettings, IDictionary serializedAdditionalRawData) { - AlertNotificationType = alertNotificationType; + EmailNotificationSettings = emailNotificationSettings; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// [Required] Specifies the type of signal to monitor. - internal MonitoringAlertNotificationType AlertNotificationType { get; set; } + /// The AML notification email settings. + internal MonitorEmailNotificationSettings EmailNotificationSettings { get; set; } + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails + { + get => EmailNotificationSettings is null ? default : EmailNotificationSettings.Emails; + set + { + if (EmailNotificationSettings is null) + EmailNotificationSettings = new MonitorEmailNotificationSettings(); + EmailNotificationSettings.Emails = value; + } + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs deleted file mode 100644 index 5e4bfe87233af..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationSettingsBase.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownMonitoringAlertNotificationSettingsBase))] - public partial class MonitoringAlertNotificationSettingsBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoringAlertNotificationSettingsBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - - internal static MonitoringAlertNotificationSettingsBase DeserializeMonitoringAlertNotificationSettingsBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("alertNotificationType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureMonitor": return AzMonMonitoringAlertNotificationSettings.DeserializeAzMonMonitoringAlertNotificationSettings(element, options); - case "Email": return EmailMonitoringAlertNotificationSettings.DeserializeEmailMonitoringAlertNotificationSettings(element, options); - } - } - return UnknownMonitoringAlertNotificationSettingsBase.DeserializeUnknownMonitoringAlertNotificationSettingsBase(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{options.Format}' format."); - } - } - - MonitoringAlertNotificationSettingsBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs deleted file mode 100644 index 8a7d19bc7e5bc..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringAlertNotificationType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MonitoringAlertNotificationType. - internal readonly partial struct MonitoringAlertNotificationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MonitoringAlertNotificationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureMonitorValue = "AzureMonitor"; - private const string EmailValue = "Email"; - - /// Settings for Azure Monitor based alerting. - public static MonitoringAlertNotificationType AzureMonitor { get; } = new MonitoringAlertNotificationType(AzureMonitorValue); - /// Settings for AML email notifications. - public static MonitoringAlertNotificationType Email { get; } = new MonitoringAlertNotificationType(EmailValue); - /// Determines if two values are the same. - public static bool operator ==(MonitoringAlertNotificationType left, MonitoringAlertNotificationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MonitoringAlertNotificationType left, MonitoringAlertNotificationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MonitoringAlertNotificationType(string value) => new MonitoringAlertNotificationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MonitoringAlertNotificationType other && Equals(other); - /// - public bool Equals(MonitoringAlertNotificationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs index 503ad60c9249c..2676753525453 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.Serialization.cs @@ -105,8 +105,8 @@ internal static MonitoringInputDataBase DeserializeMonitoringInputDataBase(JsonE switch (discriminator.GetString()) { case "Fixed": return FixedInputData.DeserializeFixedInputData(element, options); + case "Rolling": return RollingInputData.DeserializeRollingInputData(element, options); case "Static": return StaticInputData.DeserializeStaticInputData(element, options); - case "Trailing": return TrailingInputData.DeserializeTrailingInputData(element, options); } } return UnknownMonitoringInputDataBase.DeserializeUnknownMonitoringInputDataBase(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs index 58a132de83e36..cc188c85d1a11 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataBase.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Monitoring input data base definition. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public abstract partial class MonitoringInputDataBase { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs index 488917152a4bd..6a50784f81ad1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringInputDataType.cs @@ -23,13 +23,13 @@ public MonitoringInputDataType(string value) } private const string StaticValue = "Static"; - private const string TrailingValue = "Trailing"; + private const string RollingValue = "Rolling"; private const string FixedValue = "Fixed"; /// An input data with a fixed window size. public static MonitoringInputDataType Static { get; } = new MonitoringInputDataType(StaticValue); - /// An input data which trailing relatively to the monitor's current run. - public static MonitoringInputDataType Trailing { get; } = new MonitoringInputDataType(TrailingValue); + /// An input data which rolls relatively to the monitor's current run time. + public static MonitoringInputDataType Rolling { get; } = new MonitoringInputDataType(RollingValue); /// An input data with tabular format which doesn't require preprocessing. public static MonitoringInputDataType Fixed { get; } = new MonitoringInputDataType(FixedValue); /// Determines if two values are the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs deleted file mode 100644 index 0f7f898175196..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringModelType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MonitoringModelType. - public readonly partial struct MonitoringModelType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MonitoringModelType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ClassificationValue = "Classification"; - private const string RegressionValue = "Regression"; - - /// A model trained for classification tasks. - public static MonitoringModelType Classification { get; } = new MonitoringModelType(ClassificationValue); - /// A model trained for regressions tasks. - public static MonitoringModelType Regression { get; } = new MonitoringModelType(RegressionValue); - /// Determines if two values are the same. - public static bool operator ==(MonitoringModelType left, MonitoringModelType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MonitoringModelType left, MonitoringModelType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MonitoringModelType(string value) => new MonitoringModelType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MonitoringModelType other && Equals(other); - /// - public bool Equals(MonitoringModelType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs deleted file mode 100644 index 8467b207fffe5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The MonitoringNotificationMode. - public readonly partial struct MonitoringNotificationMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MonitoringNotificationMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DisabledValue = "Disabled"; - private const string EnabledValue = "Enabled"; - - /// Disabled notifications will not produce emails/metrics leveraged for alerting. - public static MonitoringNotificationMode Disabled { get; } = new MonitoringNotificationMode(DisabledValue); - /// Enabled notification will produce emails/metrics leveraged for alerting. - public static MonitoringNotificationMode Enabled { get; } = new MonitoringNotificationMode(EnabledValue); - /// Determines if two values are the same. - public static bool operator ==(MonitoringNotificationMode left, MonitoringNotificationMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MonitoringNotificationMode left, MonitoringNotificationMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MonitoringNotificationMode(string value) => new MonitoringNotificationMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MonitoringNotificationMode other && Equals(other); - /// - public bool Equals(MonitoringNotificationMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs new file mode 100644 index 0000000000000..019cbff350dba --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringNotificationType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The MonitoringNotificationType. + public readonly partial struct MonitoringNotificationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MonitoringNotificationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AmlNotificationValue = "AmlNotification"; + + /// Enables email notifications through AML notifications. + public static MonitoringNotificationType AmlNotification { get; } = new MonitoringNotificationType(AmlNotificationValue); + /// Determines if two values are the same. + public static bool operator ==(MonitoringNotificationType left, MonitoringNotificationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MonitoringNotificationType left, MonitoringNotificationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MonitoringNotificationType(string value) => new MonitoringNotificationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MonitoringNotificationType other && Equals(other); + /// + public bool Equals(MonitoringNotificationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs index eee3d06c0cbe9..5ff5888a2ac6f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs @@ -26,10 +26,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -97,9 +109,6 @@ internal static MonitoringSignalBase DeserializeMonitoringSignalBase(JsonElement case "DataDrift": return DataDriftMonitoringSignal.DeserializeDataDriftMonitoringSignal(element, options); case "DataQuality": return DataQualityMonitoringSignal.DeserializeDataQualityMonitoringSignal(element, options); case "FeatureAttributionDrift": return FeatureAttributionDriftMonitoringSignal.DeserializeFeatureAttributionDriftMonitoringSignal(element, options); - case "GenerationSafetyQuality": return GenerationSafetyQualityMonitoringSignal.DeserializeGenerationSafetyQualityMonitoringSignal(element, options); - case "GenerationTokenStatistics": return GenerationTokenStatisticsSignal.DeserializeGenerationTokenStatisticsSignal(element, options); - case "ModelPerformance": return ModelPerformanceSignal.DeserializeModelPerformanceSignal(element, options); case "PredictionDrift": return PredictionDriftMonitoringSignal.DeserializePredictionDriftMonitoringSignal(element, options); } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs index a375c432ff3fd..2aeb6c39497d1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , and . + /// The available derived classes include , , , and . /// public abstract partial class MonitoringSignalBase { @@ -51,24 +51,25 @@ public abstract partial class MonitoringSignalBase /// Initializes a new instance of . protected MonitoringSignalBase() { + NotificationTypes = new ChangeTrackingList(); Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - internal MonitoringSignalBase(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) + internal MonitoringSignalBase(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) { - Mode = mode; + NotificationTypes = notificationTypes; Properties = properties; SignalType = signalType; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The current notification mode for this signal. - public MonitoringNotificationMode? Mode { get; set; } + public IList NotificationTypes { get; set; } /// Property dictionary. Properties can be added, but not removed or altered. public IDictionary Properties { get; set; } /// [Required] Specifies the type of signal to monitor. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs index 1445538716a04..a5fa7ced5854d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalType.cs @@ -27,9 +27,6 @@ public MonitoringSignalType(string value) private const string DataQualityValue = "DataQuality"; private const string FeatureAttributionDriftValue = "FeatureAttributionDrift"; private const string CustomValue = "Custom"; - private const string ModelPerformanceValue = "ModelPerformance"; - private const string GenerationSafetyQualityValue = "GenerationSafetyQuality"; - private const string GenerationTokenStatisticsValue = "GenerationTokenStatistics"; /// Tracks model input data distribution change, comparing against training data or past production data. public static MonitoringSignalType DataDrift { get; } = new MonitoringSignalType(DataDriftValue); @@ -41,12 +38,6 @@ public MonitoringSignalType(string value) public static MonitoringSignalType FeatureAttributionDrift { get; } = new MonitoringSignalType(FeatureAttributionDriftValue); /// Tracks a custom signal provided by users. public static MonitoringSignalType Custom { get; } = new MonitoringSignalType(CustomValue); - /// Tracks model performance based on ground truth data. - public static MonitoringSignalType ModelPerformance { get; } = new MonitoringSignalType(ModelPerformanceValue); - /// Tracks the safety and quality of generated content. - public static MonitoringSignalType GenerationSafetyQuality { get; } = new MonitoringSignalType(GenerationSafetyQualityValue); - /// Tracks the token usage of generative endpoints. - public static MonitoringSignalType GenerationTokenStatistics { get; } = new MonitoringSignalType(GenerationTokenStatisticsValue); /// Determines if two values are the same. public static bool operator ==(MonitoringSignalType left, MonitoringSignalType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs index 627f5a03d5e27..22420b15967f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs @@ -46,16 +46,16 @@ public partial class MonitoringTarget private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// [Required] The machine learning task type of the model. + /// [Required] The machine learning task type of the monitored model. public MonitoringTarget(ModelTaskType taskType) { TaskType = taskType; } /// Initializes a new instance of . - /// The ARM resource ID of either the deployment targeted by this monitor. - /// The ARM resource ID of either the model targeted by this monitor. - /// [Required] The machine learning task type of the model. + /// Reference to the deployment asset targeted by this monitor. + /// Reference to the model asset targeted by this monitor. + /// [Required] The machine learning task type of the monitored model. /// Keeps track of any properties unknown to the library. internal MonitoringTarget(string deploymentId, string modelId, ModelTaskType taskType, IDictionary serializedAdditionalRawData) { @@ -70,11 +70,11 @@ internal MonitoringTarget() { } - /// The ARM resource ID of either the deployment targeted by this monitor. + /// Reference to the deployment asset targeted by this monitor. public string DeploymentId { get; set; } - /// The ARM resource ID of either the model targeted by this monitor. + /// Reference to the model asset targeted by this monitor. public string ModelId { get; set; } - /// [Required] The machine learning task type of the model. + /// [Required] The machine learning task type of the monitored model. public ModelTaskType TaskType { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs deleted file mode 100644 index 2c1c889dd9e84..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.Serialization.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class MonitoringWorkspaceConnection : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(EnvironmentVariables)) - { - if (EnvironmentVariables != null) - { - writer.WritePropertyName("environmentVariables"u8); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("environmentVariables"); - } - } - if (Optional.IsCollectionDefined(Secrets)) - { - if (Secrets != null) - { - writer.WritePropertyName("secrets"u8); - writer.WriteStartObject(); - foreach (var item in Secrets) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secrets"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoringWorkspaceConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringWorkspaceConnection(document.RootElement, options); - } - - internal static MonitoringWorkspaceConnection DeserializeMonitoringWorkspaceConnection(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary environmentVariables = default; - IDictionary secrets = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("environmentVariables"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - environmentVariables = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property.NameEquals("secrets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secrets = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - secrets = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MonitoringWorkspaceConnection(environmentVariables ?? new ChangeTrackingDictionary(), secrets ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support writing '{options.Format}' format."); - } - } - - MonitoringWorkspaceConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringWorkspaceConnection(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoringWorkspaceConnection)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs deleted file mode 100644 index 4733daa9fcf4b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringWorkspaceConnection.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Monitoring workspace connection definition. - public partial class MonitoringWorkspaceConnection - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MonitoringWorkspaceConnection() - { - EnvironmentVariables = new ChangeTrackingDictionary(); - Secrets = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// - /// The properties of a workspace service connection to store as environment variables in the submitted jobs. - /// Key is workspace connection property path, name is environment variable key. - /// - /// - /// The properties of a workspace service connection to store as secrets in the submitted jobs. - /// Key is workspace connection property path, name is secret key. - /// - /// Keeps track of any properties unknown to the library. - internal MonitoringWorkspaceConnection(IDictionary environmentVariables, IDictionary secrets, IDictionary serializedAdditionalRawData) - { - EnvironmentVariables = environmentVariables; - Secrets = secrets; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// The properties of a workspace service connection to store as environment variables in the submitted jobs. - /// Key is workspace connection property path, name is environment variable key. - /// - public IDictionary EnvironmentVariables { get; set; } - /// - /// The properties of a workspace service connection to store as secrets in the submitted jobs. - /// Key is workspace connection property path, name is secret key. - /// - public IDictionary Secrets { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MediaType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs similarity index 51% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MediaType.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs index 2d74c358353e1..7ddf80dfea74a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MediaType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs @@ -10,37 +10,37 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Media type of data asset. - internal readonly partial struct MediaType : IEquatable + /// Mount Mode. + public readonly partial struct MountMode : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public MediaType(string value) + public MountMode(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string ImageValue = "Image"; - private const string TextValue = "Text"; + private const string ReadOnlyValue = "ReadOnly"; + private const string ReadWriteValue = "ReadWrite"; - /// Image. - public static MediaType Image { get; } = new MediaType(ImageValue); - /// Text. - public static MediaType Text { get; } = new MediaType(TextValue); - /// Determines if two values are the same. - public static bool operator ==(MediaType left, MediaType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MediaType left, MediaType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MediaType(string value) => new MediaType(value); + /// ReadOnly. + public static MountMode ReadOnly { get; } = new MountMode(ReadOnlyValue); + /// ReadWrite. + public static MountMode ReadWrite { get; } = new MountMode(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(MountMode left, MountMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MountMode left, MountMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MountMode(string value) => new MountMode(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MediaType other && Equals(other); + public override bool Equals(object obj) => obj is MountMode other && Equals(other); /// - public bool Equals(MediaType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(MountMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs deleted file mode 100644 index c49bc03fa2705..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.Serialization.cs +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class NlpFixedParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(GradientAccumulationSteps)) - { - if (GradientAccumulationSteps != null) - { - writer.WritePropertyName("gradientAccumulationSteps"u8); - writer.WriteNumberValue(GradientAccumulationSteps.Value); - } - else - { - writer.WriteNull("gradientAccumulationSteps"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteNumberValue(LearningRate.Value); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(LearningRateScheduler)) - { - writer.WritePropertyName("learningRateScheduler"u8); - writer.WriteStringValue(LearningRateScheduler.Value.ToString()); - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NumberOfEpochs)) - { - if (NumberOfEpochs != null) - { - writer.WritePropertyName("numberOfEpochs"u8); - writer.WriteNumberValue(NumberOfEpochs.Value); - } - else - { - writer.WriteNull("numberOfEpochs"); - } - } - if (Optional.IsDefined(TrainingBatchSize)) - { - if (TrainingBatchSize != null) - { - writer.WritePropertyName("trainingBatchSize"u8); - writer.WriteNumberValue(TrainingBatchSize.Value); - } - else - { - writer.WriteNull("trainingBatchSize"); - } - } - if (Optional.IsDefined(ValidationBatchSize)) - { - if (ValidationBatchSize != null) - { - writer.WritePropertyName("validationBatchSize"u8); - writer.WriteNumberValue(ValidationBatchSize.Value); - } - else - { - writer.WriteNull("validationBatchSize"); - } - } - if (Optional.IsDefined(WarmupRatio)) - { - if (WarmupRatio != null) - { - writer.WritePropertyName("warmupRatio"u8); - writer.WriteNumberValue(WarmupRatio.Value); - } - else - { - writer.WriteNull("warmupRatio"); - } - } - if (Optional.IsDefined(WeightDecay)) - { - if (WeightDecay != null) - { - writer.WritePropertyName("weightDecay"u8); - writer.WriteNumberValue(WeightDecay.Value); - } - else - { - writer.WriteNull("weightDecay"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NlpFixedParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNlpFixedParameters(document.RootElement, options); - } - - internal static NlpFixedParameters DeserializeNlpFixedParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? gradientAccumulationSteps = default; - float? learningRate = default; - NlpLearningRateScheduler? learningRateScheduler = default; - string modelName = default; - int? numberOfEpochs = default; - int? trainingBatchSize = default; - int? validationBatchSize = default; - float? warmupRatio = default; - float? weightDecay = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("gradientAccumulationSteps"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - gradientAccumulationSteps = null; - continue; - } - gradientAccumulationSteps = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("learningRateScheduler"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - learningRateScheduler = new NlpLearningRateScheduler(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("numberOfEpochs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numberOfEpochs = null; - continue; - } - numberOfEpochs = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("trainingBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - trainingBatchSize = null; - continue; - } - trainingBatchSize = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("validationBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - validationBatchSize = null; - continue; - } - validationBatchSize = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("warmupRatio"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - warmupRatio = null; - continue; - } - warmupRatio = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("weightDecay"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - weightDecay = null; - continue; - } - weightDecay = property.Value.GetSingle(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NlpFixedParameters( - gradientAccumulationSteps, - learningRate, - learningRateScheduler, - modelName, - numberOfEpochs, - trainingBatchSize, - validationBatchSize, - warmupRatio, - weightDecay, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support writing '{options.Format}' format."); - } - } - - NlpFixedParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNlpFixedParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NlpFixedParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs deleted file mode 100644 index 3eba73123c656..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpFixedParameters.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Fixed training parameters that won't be swept over during AutoML NLP training. - public partial class NlpFixedParameters - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NlpFixedParameters() - { - } - - /// Initializes a new instance of . - /// Number of steps to accumulate gradients over before running a backward pass. - /// The learning rate for the training procedure. - /// The type of learning rate schedule to use during the training procedure. - /// The name of the model to train. - /// Number of training epochs. - /// The batch size for the training procedure. - /// The batch size to be used during evaluation. - /// The warmup ratio, used alongside LrSchedulerType. - /// The weight decay for the training procedure. - /// Keeps track of any properties unknown to the library. - internal NlpFixedParameters(int? gradientAccumulationSteps, float? learningRate, NlpLearningRateScheduler? learningRateScheduler, string modelName, int? numberOfEpochs, int? trainingBatchSize, int? validationBatchSize, float? warmupRatio, float? weightDecay, IDictionary serializedAdditionalRawData) - { - GradientAccumulationSteps = gradientAccumulationSteps; - LearningRate = learningRate; - LearningRateScheduler = learningRateScheduler; - ModelName = modelName; - NumberOfEpochs = numberOfEpochs; - TrainingBatchSize = trainingBatchSize; - ValidationBatchSize = validationBatchSize; - WarmupRatio = warmupRatio; - WeightDecay = weightDecay; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of steps to accumulate gradients over before running a backward pass. - public int? GradientAccumulationSteps { get; set; } - /// The learning rate for the training procedure. - public float? LearningRate { get; set; } - /// The type of learning rate schedule to use during the training procedure. - public NlpLearningRateScheduler? LearningRateScheduler { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Number of training epochs. - public int? NumberOfEpochs { get; set; } - /// The batch size for the training procedure. - public int? TrainingBatchSize { get; set; } - /// The batch size to be used during evaluation. - public int? ValidationBatchSize { get; set; } - /// The warmup ratio, used alongside LrSchedulerType. - public float? WarmupRatio { get; set; } - /// The weight decay for the training procedure. - public float? WeightDecay { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs deleted file mode 100644 index ec46849d480aa..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpLearningRateScheduler.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Enum of learning rate schedulers that aligns with those supported by HF. - public readonly partial struct NlpLearningRateScheduler : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NlpLearningRateScheduler(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string LinearValue = "Linear"; - private const string CosineValue = "Cosine"; - private const string CosineWithRestartsValue = "CosineWithRestarts"; - private const string PolynomialValue = "Polynomial"; - private const string ConstantValue = "Constant"; - private const string ConstantWithWarmupValue = "ConstantWithWarmup"; - - /// No learning rate schedule. - public static NlpLearningRateScheduler None { get; } = new NlpLearningRateScheduler(NoneValue); - /// Linear warmup and decay. - public static NlpLearningRateScheduler Linear { get; } = new NlpLearningRateScheduler(LinearValue); - /// Linear warmup then cosine decay. - public static NlpLearningRateScheduler Cosine { get; } = new NlpLearningRateScheduler(CosineValue); - /// Linear warmup, cosine decay, then restart to initial LR. - public static NlpLearningRateScheduler CosineWithRestarts { get; } = new NlpLearningRateScheduler(CosineWithRestartsValue); - /// Increase linearly then polynomially decay. - public static NlpLearningRateScheduler Polynomial { get; } = new NlpLearningRateScheduler(PolynomialValue); - /// Constant learning rate. - public static NlpLearningRateScheduler Constant { get; } = new NlpLearningRateScheduler(ConstantValue); - /// Linear warmup followed by constant value. - public static NlpLearningRateScheduler ConstantWithWarmup { get; } = new NlpLearningRateScheduler(ConstantWithWarmupValue); - /// Determines if two values are the same. - public static bool operator ==(NlpLearningRateScheduler left, NlpLearningRateScheduler right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NlpLearningRateScheduler left, NlpLearningRateScheduler right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator NlpLearningRateScheduler(string value) => new NlpLearningRateScheduler(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NlpLearningRateScheduler other && Equals(other); - /// - public bool Equals(NlpLearningRateScheduler other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs deleted file mode 100644 index 1ef1d9c0dfc22..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.Serialization.cs +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class NlpParameterSubspace : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(GradientAccumulationSteps)) - { - if (GradientAccumulationSteps != null) - { - writer.WritePropertyName("gradientAccumulationSteps"u8); - writer.WriteStringValue(GradientAccumulationSteps); - } - else - { - writer.WriteNull("gradientAccumulationSteps"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteStringValue(LearningRate); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(LearningRateScheduler)) - { - if (LearningRateScheduler != null) - { - writer.WritePropertyName("learningRateScheduler"u8); - writer.WriteStringValue(LearningRateScheduler); - } - else - { - writer.WriteNull("learningRateScheduler"); - } - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NumberOfEpochs)) - { - if (NumberOfEpochs != null) - { - writer.WritePropertyName("numberOfEpochs"u8); - writer.WriteStringValue(NumberOfEpochs); - } - else - { - writer.WriteNull("numberOfEpochs"); - } - } - if (Optional.IsDefined(TrainingBatchSize)) - { - if (TrainingBatchSize != null) - { - writer.WritePropertyName("trainingBatchSize"u8); - writer.WriteStringValue(TrainingBatchSize); - } - else - { - writer.WriteNull("trainingBatchSize"); - } - } - if (Optional.IsDefined(ValidationBatchSize)) - { - if (ValidationBatchSize != null) - { - writer.WritePropertyName("validationBatchSize"u8); - writer.WriteStringValue(ValidationBatchSize); - } - else - { - writer.WriteNull("validationBatchSize"); - } - } - if (Optional.IsDefined(WarmupRatio)) - { - if (WarmupRatio != null) - { - writer.WritePropertyName("warmupRatio"u8); - writer.WriteStringValue(WarmupRatio); - } - else - { - writer.WriteNull("warmupRatio"); - } - } - if (Optional.IsDefined(WeightDecay)) - { - if (WeightDecay != null) - { - writer.WritePropertyName("weightDecay"u8); - writer.WriteStringValue(WeightDecay); - } - else - { - writer.WriteNull("weightDecay"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NlpParameterSubspace IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNlpParameterSubspace(document.RootElement, options); - } - - internal static NlpParameterSubspace DeserializeNlpParameterSubspace(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string gradientAccumulationSteps = default; - string learningRate = default; - string learningRateScheduler = default; - string modelName = default; - string numberOfEpochs = default; - string trainingBatchSize = default; - string validationBatchSize = default; - string warmupRatio = default; - string weightDecay = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("gradientAccumulationSteps"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - gradientAccumulationSteps = null; - continue; - } - gradientAccumulationSteps = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRateScheduler"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRateScheduler = null; - continue; - } - learningRateScheduler = property.Value.GetString(); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("numberOfEpochs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numberOfEpochs = null; - continue; - } - numberOfEpochs = property.Value.GetString(); - continue; - } - if (property.NameEquals("trainingBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - trainingBatchSize = null; - continue; - } - trainingBatchSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("validationBatchSize"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - validationBatchSize = null; - continue; - } - validationBatchSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("warmupRatio"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - warmupRatio = null; - continue; - } - warmupRatio = property.Value.GetString(); - continue; - } - if (property.NameEquals("weightDecay"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - weightDecay = null; - continue; - } - weightDecay = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NlpParameterSubspace( - gradientAccumulationSteps, - learningRate, - learningRateScheduler, - modelName, - numberOfEpochs, - trainingBatchSize, - validationBatchSize, - warmupRatio, - weightDecay, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support writing '{options.Format}' format."); - } - } - - NlpParameterSubspace IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNlpParameterSubspace(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NlpParameterSubspace)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs deleted file mode 100644 index 1ea73070924a1..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpParameterSubspace.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Stringified search spaces for each parameter. See below examples. - public partial class NlpParameterSubspace - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NlpParameterSubspace() - { - } - - /// Initializes a new instance of . - /// Number of steps to accumulate gradients over before running a backward pass. - /// The learning rate for the training procedure. - /// The type of learning rate schedule to use during the training procedure. - /// The name of the model to train. - /// Number of training epochs. - /// The batch size for the training procedure. - /// The batch size to be used during evaluation. - /// The warmup ratio, used alongside LrSchedulerType. - /// The weight decay for the training procedure. - /// Keeps track of any properties unknown to the library. - internal NlpParameterSubspace(string gradientAccumulationSteps, string learningRate, string learningRateScheduler, string modelName, string numberOfEpochs, string trainingBatchSize, string validationBatchSize, string warmupRatio, string weightDecay, IDictionary serializedAdditionalRawData) - { - GradientAccumulationSteps = gradientAccumulationSteps; - LearningRate = learningRate; - LearningRateScheduler = learningRateScheduler; - ModelName = modelName; - NumberOfEpochs = numberOfEpochs; - TrainingBatchSize = trainingBatchSize; - ValidationBatchSize = validationBatchSize; - WarmupRatio = warmupRatio; - WeightDecay = weightDecay; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Number of steps to accumulate gradients over before running a backward pass. - public string GradientAccumulationSteps { get; set; } - /// The learning rate for the training procedure. - public string LearningRate { get; set; } - /// The type of learning rate schedule to use during the training procedure. - public string LearningRateScheduler { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Number of training epochs. - public string NumberOfEpochs { get; set; } - /// The batch size for the training procedure. - public string TrainingBatchSize { get; set; } - /// The batch size to be used during evaluation. - public string ValidationBatchSize { get; set; } - /// The warmup ratio, used alongside LrSchedulerType. - public string WarmupRatio { get; set; } - /// The weight decay for the training procedure. - public string WeightDecay { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs deleted file mode 100644 index c3c9710ad031e..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class NlpSweepSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EarlyTermination)) - { - if (EarlyTermination != null) - { - writer.WritePropertyName("earlyTermination"u8); - writer.WriteObjectValue(EarlyTermination, options); - } - else - { - writer.WriteNull("earlyTermination"); - } - } - writer.WritePropertyName("samplingAlgorithm"u8); - writer.WriteStringValue(SamplingAlgorithm.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NlpSweepSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNlpSweepSettings(document.RootElement, options); - } - - internal static NlpSweepSettings DeserializeNlpSweepSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MachineLearningEarlyTerminationPolicy earlyTermination = default; - SamplingAlgorithmType samplingAlgorithm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("earlyTermination"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - earlyTermination = null; - continue; - } - earlyTermination = MachineLearningEarlyTerminationPolicy.DeserializeMachineLearningEarlyTerminationPolicy(property.Value, options); - continue; - } - if (property.NameEquals("samplingAlgorithm"u8)) - { - samplingAlgorithm = new SamplingAlgorithmType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NlpSweepSettings(earlyTermination, samplingAlgorithm, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support writing '{options.Format}' format."); - } - } - - NlpSweepSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNlpSweepSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NlpSweepSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs deleted file mode 100644 index 4dfb5f583517d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpSweepSettings.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Model sweeping and hyperparameter tuning related settings. - public partial class NlpSweepSettings - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// [Required] Type of sampling algorithm. - public NlpSweepSettings(SamplingAlgorithmType samplingAlgorithm) - { - SamplingAlgorithm = samplingAlgorithm; - } - - /// Initializes a new instance of . - /// - /// Type of early termination policy for the sweeping job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// [Required] Type of sampling algorithm. - /// Keeps track of any properties unknown to the library. - internal NlpSweepSettings(MachineLearningEarlyTerminationPolicy earlyTermination, SamplingAlgorithmType samplingAlgorithm, IDictionary serializedAdditionalRawData) - { - EarlyTermination = earlyTermination; - SamplingAlgorithm = samplingAlgorithm; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NlpSweepSettings() - { - } - - /// - /// Type of early termination policy for the sweeping job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public MachineLearningEarlyTerminationPolicy EarlyTermination { get; set; } - /// [Required] Type of sampling algorithm. - public SamplingAlgorithmType SamplingAlgorithm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs index 94cb191571c00..8cc83bff03bc9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs @@ -31,11 +31,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("maxConcurrentTrials"u8); writer.WriteNumberValue(MaxConcurrentTrials.Value); } - if (Optional.IsDefined(MaxNodes)) - { - writer.WritePropertyName("maxNodes"u8); - writer.WriteNumberValue(MaxNodes.Value); - } if (Optional.IsDefined(MaxTrials)) { writer.WritePropertyName("maxTrials"u8); @@ -46,11 +41,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("timeout"u8); writer.WriteStringValue(Timeout.Value, "P"); } - if (Optional.IsDefined(TrialTimeout)) - { - writer.WritePropertyName("trialTimeout"u8); - writer.WriteStringValue(TrialTimeout.Value, "P"); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -90,10 +80,8 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso return null; } int? maxConcurrentTrials = default; - int? maxNodes = default; int? maxTrials = default; TimeSpan? timeout = default; - TimeSpan? trialTimeout = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -107,15 +95,6 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso maxConcurrentTrials = property.Value.GetInt32(); continue; } - if (property.NameEquals("maxNodes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxNodes = property.Value.GetInt32(); - continue; - } if (property.NameEquals("maxTrials"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -134,28 +113,13 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso timeout = property.Value.GetTimeSpan("P"); continue; } - if (property.NameEquals("trialTimeout"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trialTimeout = property.Value.GetTimeSpan("P"); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new NlpVerticalLimitSettings( - maxConcurrentTrials, - maxNodes, - maxTrials, - timeout, - trialTimeout, - serializedAdditionalRawData); + return new NlpVerticalLimitSettings(maxConcurrentTrials, maxTrials, timeout, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs index 84e4aa3257deb..6b5393c274eb3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs @@ -52,30 +52,22 @@ public NlpVerticalLimitSettings() /// Initializes a new instance of . /// Maximum Concurrent AutoML iterations. - /// Maximum nodes to use for the experiment. /// Number of AutoML iterations. /// AutoML job timeout. - /// Timeout for individual HD trials. /// Keeps track of any properties unknown to the library. - internal NlpVerticalLimitSettings(int? maxConcurrentTrials, int? maxNodes, int? maxTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) + internal NlpVerticalLimitSettings(int? maxConcurrentTrials, int? maxTrials, TimeSpan? timeout, IDictionary serializedAdditionalRawData) { MaxConcurrentTrials = maxConcurrentTrials; - MaxNodes = maxNodes; MaxTrials = maxTrials; Timeout = timeout; - TrialTimeout = trialTimeout; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Maximum Concurrent AutoML iterations. public int? MaxConcurrentTrials { get; set; } - /// Maximum nodes to use for the experiment. - public int? MaxNodes { get; set; } /// Number of AutoML iterations. public int? MaxTrials { get; set; } /// AutoML job timeout. public TimeSpan? Timeout { get; set; } - /// Timeout for individual HD trials. - public TimeSpan? TrialTimeout { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs index 07f7196726eca..353f2c25d82c2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NodesValueType.cs @@ -23,12 +23,9 @@ public NodesValueType(string value) } private const string AllValue = "All"; - private const string CustomValue = "Custom"; /// All. public static NodesValueType All { get; } = new NodesValueType(AllValue); - /// Custom. - public static NodesValueType Custom { get; } = new NodesValueType(CustomValue); /// Determines if two values are the same. public static bool operator ==(NodesValueType left, NodesValueType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs new file mode 100644 index 0000000000000..fc82e1b98c278 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OAuth2AuthTypeWorkspaceConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OAuth2AuthTypeWorkspaceConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + + internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WorkspaceConnectionOAuth2 credentials = default; + MachineLearningConnectionAuthType authType = default; + MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = WorkspaceConnectionOAuth2.DeserializeWorkspaceConnectionOAuth2(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new MachineLearningConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new MachineLearningConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OAuth2AuthTypeWorkspaceConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + OAuth2AuthTypeWorkspaceConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOAuth2AuthTypeWorkspaceConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OAuth2AuthTypeWorkspaceConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs new file mode 100644 index 0000000000000..7385aab9bbac3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OAuth2AuthTypeWorkspaceConnectionProperties. + public partial class OAuth2AuthTypeWorkspaceConnectionProperties : MachineLearningWorkspaceConnectionProperties + { + /// Initializes a new instance of . + public OAuth2AuthTypeWorkspaceConnectionProperties() + { + AuthType = MachineLearningConnectionAuthType.OAuth2; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + internal OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionOAuth2 credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + public WorkspaceConnectionOAuth2 Credentials { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs new file mode 100644 index 0000000000000..4cd3339dfc5a9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OSPatchingStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchStatus)) + { + writer.WritePropertyName("patchStatus"u8); + writer.WriteStringValue(PatchStatus.Value.ToString()); + } + if (Optional.IsDefined(LatestPatchTime)) + { + writer.WritePropertyName("latestPatchTime"u8); + writer.WriteStringValue(LatestPatchTime); + } + if (Optional.IsDefined(RebootPending)) + { + writer.WritePropertyName("rebootPending"u8); + writer.WriteBooleanValue(RebootPending.Value); + } + if (Optional.IsDefined(ScheduledRebootTime)) + { + writer.WritePropertyName("scheduledRebootTime"u8); + writer.WriteStringValue(ScheduledRebootTime); + } + if (Optional.IsCollectionDefined(OSPatchingErrors)) + { + if (OSPatchingErrors != null) + { + writer.WritePropertyName("osPatchingErrors"u8); + writer.WriteStartArray(); + foreach (var item in OSPatchingErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("osPatchingErrors"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OSPatchingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSPatchingStatus(document.RootElement, options); + } + + internal static OSPatchingStatus DeserializeOSPatchingStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PatchStatus? patchStatus = default; + string latestPatchTime = default; + bool? rebootPending = default; + string scheduledRebootTime = default; + IReadOnlyList osPatchingErrors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchStatus = new PatchStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestPatchTime"u8)) + { + latestPatchTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("rebootPending"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootPending = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("scheduledRebootTime"u8)) + { + scheduledRebootTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("osPatchingErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + osPatchingErrors = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineLearningError.DeserializeMachineLearningError(item, options)); + } + osPatchingErrors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSPatchingStatus( + patchStatus, + latestPatchTime, + rebootPending, + scheduledRebootTime, + osPatchingErrors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support writing '{options.Format}' format."); + } + } + + OSPatchingStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSPatchingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs new file mode 100644 index 0000000000000..efe37b03843a6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Returns metadata about the os patching. + public partial class OSPatchingStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OSPatchingStatus() + { + OSPatchingErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The os patching status. + /// Time of the latest os patching. + /// Specifies whether this compute instance is pending for reboot to finish os patching. + /// Time of scheduled reboot. + /// Collection of errors encountered when doing os patching. + /// Keeps track of any properties unknown to the library. + internal OSPatchingStatus(PatchStatus? patchStatus, string latestPatchTime, bool? rebootPending, string scheduledRebootTime, IReadOnlyList osPatchingErrors, IDictionary serializedAdditionalRawData) + { + PatchStatus = patchStatus; + LatestPatchTime = latestPatchTime; + RebootPending = rebootPending; + ScheduledRebootTime = scheduledRebootTime; + OSPatchingErrors = osPatchingErrors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The os patching status. + public PatchStatus? PatchStatus { get; } + /// Time of the latest os patching. + public string LatestPatchTime { get; } + /// Specifies whether this compute instance is pending for reboot to finish os patching. + public bool? RebootPending { get; } + /// Time of scheduled reboot. + public string ScheduledRebootTime { get; } + /// Collection of errors encountered when doing os patching. + public IReadOnlyList OSPatchingErrors { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs index 0285b9b1e156a..9b7bd75301988 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.Serialization.cs @@ -51,18 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -160,7 +148,6 @@ internal static OneLakeDatastore DeserializeOneLakeDatastore(JsonElement element MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default; MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = default; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -208,16 +195,6 @@ internal static OneLakeDatastore DeserializeOneLakeDatastore(JsonElement element datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -280,7 +257,6 @@ internal static OneLakeDatastore DeserializeOneLakeDatastore(JsonElement element serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault, artifact, endpoint, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs index d8b9806c14781..e9e567d8bdbf7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs @@ -17,7 +17,7 @@ public partial class OneLakeDatastore : MachineLearningDatastoreProperties /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// /// [Required] OneLake artifact backing the datastore. @@ -45,10 +45,9 @@ public OneLakeDatastore(MachineLearningDatastoreCredentials credentials, OneLake /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. /// /// [Required] OneLake artifact backing the datastore. @@ -58,7 +57,7 @@ public OneLakeDatastore(MachineLearningDatastoreCredentials credentials, OneLake /// OneLake endpoint to use for the datastore. /// [Required] OneLake workspace name. /// Indicates which identity to use to authenticate service data access to customer's storage. - internal OneLakeDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault, OneLakeArtifact artifact, string endpoint, string oneLakeWorkspaceName, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal OneLakeDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, OneLakeArtifact artifact, string endpoint, string oneLakeWorkspaceName, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { Artifact = artifact; Endpoint = endpoint; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs deleted file mode 100644 index 46b24553366ea..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class OnlineInferenceConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Configurations)) - { - if (Configurations != null) - { - writer.WritePropertyName("configurations"u8); - writer.WriteStartObject(); - foreach (var item in Configurations) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("configurations"); - } - } - if (Optional.IsDefined(EntryScript)) - { - if (EntryScript != null) - { - writer.WritePropertyName("entryScript"u8); - writer.WriteStringValue(EntryScript); - } - else - { - writer.WriteNull("entryScript"); - } - } - if (Optional.IsDefined(LivenessRoute)) - { - if (LivenessRoute != null) - { - writer.WritePropertyName("livenessRoute"u8); - writer.WriteObjectValue(LivenessRoute, options); - } - else - { - writer.WriteNull("livenessRoute"); - } - } - if (Optional.IsDefined(ReadinessRoute)) - { - if (ReadinessRoute != null) - { - writer.WritePropertyName("readinessRoute"u8); - writer.WriteObjectValue(ReadinessRoute, options); - } - else - { - writer.WriteNull("readinessRoute"); - } - } - if (Optional.IsDefined(ScoringRoute)) - { - if (ScoringRoute != null) - { - writer.WritePropertyName("scoringRoute"u8); - writer.WriteObjectValue(ScoringRoute, options); - } - else - { - writer.WriteNull("scoringRoute"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - OnlineInferenceConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOnlineInferenceConfiguration(document.RootElement, options); - } - - internal static OnlineInferenceConfiguration DeserializeOnlineInferenceConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary configurations = default; - string entryScript = default; - MachineLearningInferenceContainerRoute livenessRoute = default; - MachineLearningInferenceContainerRoute readinessRoute = default; - MachineLearningInferenceContainerRoute scoringRoute = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("configurations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - configurations = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - configurations = dictionary; - continue; - } - if (property.NameEquals("entryScript"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - entryScript = null; - continue; - } - entryScript = property.Value.GetString(); - continue; - } - if (property.NameEquals("livenessRoute"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - livenessRoute = null; - continue; - } - livenessRoute = MachineLearningInferenceContainerRoute.DeserializeMachineLearningInferenceContainerRoute(property.Value, options); - continue; - } - if (property.NameEquals("readinessRoute"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - readinessRoute = null; - continue; - } - readinessRoute = MachineLearningInferenceContainerRoute.DeserializeMachineLearningInferenceContainerRoute(property.Value, options); - continue; - } - if (property.NameEquals("scoringRoute"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - scoringRoute = null; - continue; - } - scoringRoute = MachineLearningInferenceContainerRoute.DeserializeMachineLearningInferenceContainerRoute(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new OnlineInferenceConfiguration( - configurations ?? new ChangeTrackingDictionary(), - entryScript, - livenessRoute, - readinessRoute, - scoringRoute, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support writing '{options.Format}' format."); - } - } - - OnlineInferenceConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOnlineInferenceConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(OnlineInferenceConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs deleted file mode 100644 index 6f4c6a6fec16c..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OnlineInferenceConfiguration.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Online inference configuration options. - public partial class OnlineInferenceConfiguration - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public OnlineInferenceConfiguration() - { - Configurations = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Additional configurations. - /// Entry script or command to invoke. - /// The route to check the liveness of the inference server container. - /// The route to check the readiness of the inference server container. - /// The port to send the scoring requests to, within the inference server container. - /// Keeps track of any properties unknown to the library. - internal OnlineInferenceConfiguration(IDictionary configurations, string entryScript, MachineLearningInferenceContainerRoute livenessRoute, MachineLearningInferenceContainerRoute readinessRoute, MachineLearningInferenceContainerRoute scoringRoute, IDictionary serializedAdditionalRawData) - { - Configurations = configurations; - EntryScript = entryScript; - LivenessRoute = livenessRoute; - ReadinessRoute = readinessRoute; - ScoringRoute = scoringRoute; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Additional configurations. - public IDictionary Configurations { get; set; } - /// Entry script or command to invoke. - public string EntryScript { get; set; } - /// The route to check the liveness of the inference server container. - public MachineLearningInferenceContainerRoute LivenessRoute { get; set; } - /// The route to check the readiness of the inference server container. - public MachineLearningInferenceContainerRoute ReadinessRoute { get; set; } - /// The port to send the scoring requests to, within the inference server container. - public MachineLearningInferenceContainerRoute ScoringRoute { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..b4fd7a3ec41a4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OpenAIEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OpenAIEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static OpenAIEndpointDeploymentResourceProperties DeserializeOpenAIEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..f735423231505 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OpenAIEndpointDeploymentResourceProperties. + public partial class OpenAIEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.OpenAI"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal OpenAIEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.OpenAI"; + } + + /// Initializes a new instance of for deserialization. + internal OpenAIEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..b79f2cb16cda8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OpenAIEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OpenAIEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIEndpointResourceProperties(document.RootElement, options); + } + + internal static OpenAIEndpointResourceProperties DeserializeOpenAIEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs new file mode 100644 index 0000000000000..fe0f3b0685768 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OpenAIEndpointResourceProperties. + public partial class OpenAIEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public OpenAIEndpointResourceProperties() + { + EndpointType = EndpointType.AzureOpenAI; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal OpenAIEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs index 7dfcd399a7d0d..dbd01ddb0c868 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OutboundRuleCategory.cs @@ -25,6 +25,7 @@ public OutboundRuleCategory(string value) private const string RequiredValue = "Required"; private const string RecommendedValue = "Recommended"; private const string UserDefinedValue = "UserDefined"; + private const string DependencyValue = "Dependency"; /// Required. public static OutboundRuleCategory Required { get; } = new OutboundRuleCategory(RequiredValue); @@ -32,6 +33,8 @@ public OutboundRuleCategory(string value) public static OutboundRuleCategory Recommended { get; } = new OutboundRuleCategory(RecommendedValue); /// UserDefined. public static OutboundRuleCategory UserDefined { get; } = new OutboundRuleCategory(UserDefinedValue); + /// Dependency. + public static OutboundRuleCategory Dependency { get; } = new OutboundRuleCategory(DependencyValue); /// Determines if two values are the same. public static bool operator ==(OutboundRuleCategory left, OutboundRuleCategory right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs deleted file mode 100644 index 1ab14a151d716..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageBuildState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package build state returned in package response. - public readonly partial struct PackageBuildState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PackageBuildState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NotStartedValue = "NotStarted"; - private const string RunningValue = "Running"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - - /// NotStarted. - public static PackageBuildState NotStarted { get; } = new PackageBuildState(NotStartedValue); - /// Running. - public static PackageBuildState Running { get; } = new PackageBuildState(RunningValue); - /// Succeeded. - public static PackageBuildState Succeeded { get; } = new PackageBuildState(SucceededValue); - /// Failed. - public static PackageBuildState Failed { get; } = new PackageBuildState(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(PackageBuildState left, PackageBuildState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PackageBuildState left, PackageBuildState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PackageBuildState(string value) => new PackageBuildState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PackageBuildState other && Equals(other); - /// - public bool Equals(PackageBuildState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs deleted file mode 100644 index 5b0c9b3e57e30..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputDeliveryMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Mounting type of the model or the inputs. - public readonly partial struct PackageInputDeliveryMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PackageInputDeliveryMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CopyValue = "Copy"; - private const string DownloadValue = "Download"; - - /// Copy. - public static PackageInputDeliveryMode Copy { get; } = new PackageInputDeliveryMode(CopyValue); - /// Download. - public static PackageInputDeliveryMode Download { get; } = new PackageInputDeliveryMode(DownloadValue); - /// Determines if two values are the same. - public static bool operator ==(PackageInputDeliveryMode left, PackageInputDeliveryMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PackageInputDeliveryMode left, PackageInputDeliveryMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PackageInputDeliveryMode(string value) => new PackageInputDeliveryMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PackageInputDeliveryMode other && Equals(other); - /// - public bool Equals(PackageInputDeliveryMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs deleted file mode 100644 index df687ee6bbf85..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.Serialization.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - [PersistableModelProxy(typeof(UnknownPackageInputPathBase))] - public partial class PackageInputPathBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PackageInputPathBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathBase(document.RootElement, options); - } - - internal static PackageInputPathBase DeserializePackageInputPathBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("inputPathType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "PathId": return PackageInputPathId.DeserializePackageInputPathId(element, options); - case "PathVersion": return PackageInputPathVersion.DeserializePackageInputPathVersion(element, options); - case "Url": return PackageInputPathUri.DeserializePackageInputPathUri(element, options); - } - } - return UnknownPackageInputPathBase.DeserializeUnknownPackageInputPathBase(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{options.Format}' format."); - } - } - - PackageInputPathBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs deleted file mode 100644 index 0a248dc409f05..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathBase.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class PackageInputPathBase - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected PackageInputPathBase() - { - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - internal PackageInputPathBase(InputPathType inputPathType, IDictionary serializedAdditionalRawData) - { - InputPathType = inputPathType; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// [Required] Input path type for package inputs. - internal InputPathType InputPathType { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs deleted file mode 100644 index 001c51424c593..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package input path specified with a resource id. - public partial class PackageInputPathId : PackageInputPathBase - { - /// Initializes a new instance of . - public PackageInputPathId() - { - InputPathType = InputPathType.PathId; - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - /// Input resource id. - internal PackageInputPathId(InputPathType inputPathType, IDictionary serializedAdditionalRawData, ResourceIdentifier resourceId) : base(inputPathType, serializedAdditionalRawData) - { - ResourceId = resourceId; - InputPathType = inputPathType; - } - - /// Input resource id. - public ResourceIdentifier ResourceId { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs deleted file mode 100644 index d7e7796ef8dad..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package input path specified as an url. - public partial class PackageInputPathUri : PackageInputPathBase - { - /// Initializes a new instance of . - public PackageInputPathUri() - { - InputPathType = InputPathType.Url; - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - /// Input path url. - internal PackageInputPathUri(InputPathType inputPathType, IDictionary serializedAdditionalRawData, Uri uri) : base(inputPathType, serializedAdditionalRawData) - { - Uri = uri; - InputPathType = inputPathType; - } - - /// Input path url. - public Uri Uri { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs deleted file mode 100644 index 447ed515fe2ac..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Package input path specified with name and version. - public partial class PackageInputPathVersion : PackageInputPathBase - { - /// Initializes a new instance of . - public PackageInputPathVersion() - { - InputPathType = InputPathType.PathVersion; - } - - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - /// Input resource name. - /// Input resource version. - internal PackageInputPathVersion(InputPathType inputPathType, IDictionary serializedAdditionalRawData, string resourceName, string resourceVersion) : base(inputPathType, serializedAdditionalRawData) - { - ResourceName = resourceName; - ResourceVersion = resourceVersion; - InputPathType = inputPathType; - } - - /// Input resource name. - public string ResourceName { get; set; } - /// Input resource version. - public string ResourceVersion { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs deleted file mode 100644 index bbc96f6eb69ba..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Type of the inputs. - public readonly partial struct PackageInputType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PackageInputType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UriFileValue = "UriFile"; - private const string UriFolderValue = "UriFolder"; - - /// UriFile. - public static PackageInputType UriFile { get; } = new PackageInputType(UriFileValue); - /// UriFolder. - public static PackageInputType UriFolder { get; } = new PackageInputType(UriFolderValue); - /// Determines if two values are the same. - public static bool operator ==(PackageInputType left, PackageInputType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PackageInputType left, PackageInputType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PackageInputType(string value) => new PackageInputType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PackageInputType other && Equals(other); - /// - public bool Equals(PackageInputType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs deleted file mode 100644 index 8beceb33a03fa..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialJobBase.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Mutable base definition for a job. - internal partial class PartialJobBase - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public PartialJobBase() - { - } - - /// Initializes a new instance of . - /// Mutable notification setting for the job. - /// Keeps track of any properties unknown to the library. - internal PartialJobBase(PartialNotificationSetting notificationSetting, IDictionary serializedAdditionalRawData) - { - NotificationSetting = notificationSetting; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Mutable notification setting for the job. - internal PartialNotificationSetting NotificationSetting { get; set; } - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public IDictionary NotificationSettingWebhooks - { - get => NotificationSetting is null ? default : NotificationSetting.Webhooks; - set - { - if (NotificationSetting is null) - NotificationSetting = new PartialNotificationSetting(); - NotificationSetting.Webhooks = value; - } - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs deleted file mode 100644 index 4a30a8a6245dd..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Mutable configuration for notification. - internal partial class PartialNotificationSetting - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public PartialNotificationSetting() - { - Webhooks = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Keeps track of any properties unknown to the library. - internal PartialNotificationSetting(IDictionary webhooks, IDictionary serializedAdditionalRawData) - { - Webhooks = webhooks; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public IDictionary Webhooks { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs new file mode 100644 index 0000000000000..cf568facb6ea5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The os patching status. + public readonly partial struct PatchStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + private const string FailedValue = "Failed"; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string UnknownValue = "Unknown"; + + /// CompletedWithWarnings. + public static PatchStatus CompletedWithWarnings { get; } = new PatchStatus(CompletedWithWarningsValue); + /// Failed. + public static PatchStatus Failed { get; } = new PatchStatus(FailedValue); + /// InProgress. + public static PatchStatus InProgress { get; } = new PatchStatus(InProgressValue); + /// Succeeded. + public static PatchStatus Succeeded { get; } = new PatchStatus(SucceededValue); + /// Unknown. + public static PatchStatus Unknown { get; } = new PatchStatus(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(PatchStatus left, PatchStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchStatus left, PatchStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchStatus(string value) => new PatchStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchStatus other && Equals(other); + /// + public bool Equals(PatchStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs index aaa92c6eb6f91..8b0d116bb9ad8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) + { + if (FeatureDataTypeOverride != null) + { + writer.WritePropertyName("featureDataTypeOverride"u8); + writer.WriteStartObject(); + foreach (var item in FeatureDataTypeOverride) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("featureDataTypeOverride"); + } + } writer.WritePropertyName("metricThresholds"u8); writer.WriteStartArray(); foreach (var item in MetricThresholds) @@ -33,16 +51,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); writer.WritePropertyName("productionData"u8); writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -102,17 +130,32 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito { return null; } + IDictionary featureDataTypeOverride = default; IList metricThresholds = default; - MonitoringModelType modelType = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } if (property.NameEquals("metricThresholds"u8)) { List array = new List(); @@ -123,11 +166,6 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito metricThresholds = array; continue; } - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } if (property.NameEquals("productionData"u8)) { productionData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); @@ -138,13 +176,19 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -174,12 +218,12 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito } serializedAdditionalRawData = rawDataDictionary; return new PredictionDriftMonitoringSignal( - mode, + notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData, + featureDataTypeOverride ?? new ChangeTrackingDictionary(), metricThresholds, - modelType, productionData, referenceData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs index 21102724df894..f26fdd50121ba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs @@ -20,56 +20,55 @@ public partial class PredictionDriftMonitoringSignal : MonitoringSignalBase /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// [Required] The type of the model monitored. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// , or is null. - public PredictionDriftMonitoringSignal(IEnumerable metricThresholds, MonitoringModelType modelType, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) + public PredictionDriftMonitoringSignal(IEnumerable metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) { Argument.AssertNotNull(metricThresholds, nameof(metricThresholds)); Argument.AssertNotNull(productionData, nameof(productionData)); Argument.AssertNotNull(referenceData, nameof(referenceData)); + FeatureDataTypeOverride = new ChangeTrackingDictionary(); MetricThresholds = metricThresholds.ToList(); - ModelType = modelType; ProductionData = productionData; ReferenceData = referenceData; SignalType = MonitoringSignalType.PredictionDrift; } /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. + /// A dictionary that maps feature names to their respective data types. /// /// [Required] A list of metrics to calculate and their associated thresholds. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// [Required] The type of the model monitored. /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// - internal PredictionDriftMonitoringSignal(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IList metricThresholds, MonitoringModelType modelType, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal PredictionDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { + FeatureDataTypeOverride = featureDataTypeOverride; MetricThresholds = metricThresholds; - ModelType = modelType; ProductionData = productionData; ReferenceData = referenceData; SignalType = signalType; @@ -80,24 +79,24 @@ internal PredictionDriftMonitoringSignal() { } + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } /// /// [Required] A list of metrics to calculate and their associated thresholds. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// public IList MetricThresholds { get; } - /// [Required] The type of the model monitored. - public MonitoringModelType ModelType { get; set; } /// /// [Required] The data which drift will be calculated for. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ProductionData { get; set; } /// /// [Required] The data to calculate drift against. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , and . /// public MonitoringInputDataBase ReferenceData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs index 55a1a92f389ca..5504cb6b48a21 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.Serialization.cs @@ -84,7 +84,7 @@ internal static PrivateEndpointDestination DeserializePrivateEndpointDestination { return null; } - string serviceResourceId = default; + ResourceIdentifier serviceResourceId = default; bool? sparkEnabled = default; OutboundRuleStatus? sparkStatus = default; string subresourceTarget = default; @@ -94,7 +94,11 @@ internal static PrivateEndpointDestination DeserializePrivateEndpointDestination { if (property.NameEquals("serviceResourceId"u8)) { - serviceResourceId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceResourceId = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("sparkEnabled"u8)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs index 29be5c6cb4878..73e8226e5e02b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointDestination.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -56,7 +57,7 @@ public PrivateEndpointDestination() /// Type of a managed network Outbound Rule of a machine learning workspace. /// /// Keeps track of any properties unknown to the library. - internal PrivateEndpointDestination(string serviceResourceId, bool? sparkEnabled, OutboundRuleStatus? sparkStatus, string subresourceTarget, IDictionary serializedAdditionalRawData) + internal PrivateEndpointDestination(ResourceIdentifier serviceResourceId, bool? sparkEnabled, OutboundRuleStatus? sparkStatus, string subresourceTarget, IDictionary serializedAdditionalRawData) { ServiceResourceId = serviceResourceId; SparkEnabled = sparkEnabled; @@ -66,7 +67,7 @@ internal PrivateEndpointDestination(string serviceResourceId, bool? sparkEnabled } /// Gets or sets the service resource id. - public string ServiceResourceId { get; set; } + public ResourceIdentifier ServiceResourceId { get; set; } /// Gets or sets the spark enabled. public bool? SparkEnabled { get; set; } /// Type of a managed network Outbound Rule of a machine learning workspace. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs index 01e9b4c88fa7b..7e66f6fa245ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs @@ -31,11 +31,31 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("destination"u8); writer.WriteObjectValue(Destination, options); } + if (Optional.IsCollectionDefined(Fqdns)) + { + writer.WritePropertyName("fqdns"u8); + writer.WriteStartArray(); + foreach (var item in Fqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Category)) { writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -82,7 +102,9 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu return null; } PrivateEndpointDestination destination = default; + IList fqdns = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -98,6 +120,20 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu destination = PrivateEndpointDestination.DeserializePrivateEndpointDestination(property.Value, options); continue; } + if (property.NameEquals("fqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + fqdns = array; + continue; + } if (property.NameEquals("category"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -107,6 +143,20 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,7 +177,14 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu } } serializedAdditionalRawData = rawDataDictionary; - return new PrivateEndpointOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new PrivateEndpointOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination, + fqdns ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs index 320e28bbee68a..429377fc8c6d9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs @@ -16,22 +16,28 @@ public partial class PrivateEndpointOutboundRule : MachineLearningOutboundRule /// Initializes a new instance of . public PrivateEndpointOutboundRule() { + Fqdns = new ChangeTrackingList(); OutboundRuleType = OutboundRuleType.PrivateEndpoint; } /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - internal PrivateEndpointOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, PrivateEndpointDestination destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + /// + internal PrivateEndpointOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, PrivateEndpointDestination destination, IList fqdns) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; + Fqdns = fqdns; OutboundRuleType = outboundRuleType; } /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. public PrivateEndpointDestination Destination { get; set; } + /// Gets the fqdns. + public IList Fqdns { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs deleted file mode 100644 index b84a38300209a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.Serialization.cs +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class ProgressMetrics : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(CompletedDatapointCount)) - { - if (CompletedDatapointCount != null) - { - writer.WritePropertyName("completedDatapointCount"u8); - writer.WriteNumberValue(CompletedDatapointCount.Value); - } - else - { - writer.WriteNull("completedDatapointCount"); - } - } - if (options.Format != "W" && Optional.IsDefined(IncrementalDataLastRefreshOn)) - { - if (IncrementalDataLastRefreshOn != null) - { - writer.WritePropertyName("incrementalDataLastRefreshDateTime"u8); - writer.WriteStringValue(IncrementalDataLastRefreshOn.Value, "O"); - } - else - { - writer.WriteNull("incrementalDataLastRefreshDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(SkippedDatapointCount)) - { - if (SkippedDatapointCount != null) - { - writer.WritePropertyName("skippedDatapointCount"u8); - writer.WriteNumberValue(SkippedDatapointCount.Value); - } - else - { - writer.WriteNull("skippedDatapointCount"); - } - } - if (options.Format != "W" && Optional.IsDefined(TotalDatapointCount)) - { - if (TotalDatapointCount != null) - { - writer.WritePropertyName("totalDatapointCount"u8); - writer.WriteNumberValue(TotalDatapointCount.Value); - } - else - { - writer.WriteNull("totalDatapointCount"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ProgressMetrics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProgressMetrics(document.RootElement, options); - } - - internal static ProgressMetrics DeserializeProgressMetrics(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - long? completedDatapointCount = default; - DateTimeOffset? incrementalDataLastRefreshDateTime = default; - long? skippedDatapointCount = default; - long? totalDatapointCount = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("completedDatapointCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - completedDatapointCount = null; - continue; - } - completedDatapointCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("incrementalDataLastRefreshDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - incrementalDataLastRefreshDateTime = null; - continue; - } - incrementalDataLastRefreshDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("skippedDatapointCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - skippedDatapointCount = null; - continue; - } - skippedDatapointCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("totalDatapointCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - totalDatapointCount = null; - continue; - } - totalDatapointCount = property.Value.GetInt64(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProgressMetrics(completedDatapointCount, incrementalDataLastRefreshDateTime, skippedDatapointCount, totalDatapointCount, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support writing '{options.Format}' format."); - } - } - - ProgressMetrics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProgressMetrics(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProgressMetrics)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs deleted file mode 100644 index e198cc2b3f3a2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ProgressMetrics.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Progress metrics definition. - public partial class ProgressMetrics - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProgressMetrics() - { - } - - /// Initializes a new instance of . - /// The completed datapoint count. - /// The time of last successful incremental data refresh in UTC. - /// The skipped datapoint count. - /// The total datapoint count. - /// Keeps track of any properties unknown to the library. - internal ProgressMetrics(long? completedDatapointCount, DateTimeOffset? incrementalDataLastRefreshOn, long? skippedDatapointCount, long? totalDatapointCount, IDictionary serializedAdditionalRawData) - { - CompletedDatapointCount = completedDatapointCount; - IncrementalDataLastRefreshOn = incrementalDataLastRefreshOn; - SkippedDatapointCount = skippedDatapointCount; - TotalDatapointCount = totalDatapointCount; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The completed datapoint count. - public long? CompletedDatapointCount { get; } - /// The time of last successful incremental data refresh in UTC. - public DateTimeOffset? IncrementalDataLastRefreshOn { get; } - /// The skipped datapoint count. - public long? SkippedDatapointCount { get; } - /// The total datapoint count. - public long? TotalDatapointCount { get; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs index 2cf86537a7260..129c212193248 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathId.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs @@ -13,33 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class PackageInputPathId : IUtf8JsonSerializable, IJsonModel + public partial class RaiBlocklistConfig : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ResourceId)) + if (Optional.IsDefined(Blocking)) { - if (ResourceId != null) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - else - { - writer.WriteNull("resourceId"); - } + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); + } + if (Optional.IsDefined(BlocklistName)) + { + writer.WritePropertyName("blocklistName"u8); + writer.WriteStringValue(BlocklistName); } - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndObject(); } - PackageInputPathId IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RaiBlocklistConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathId(document.RootElement, options); + return DeserializeRaiBlocklistConfig(document.RootElement, options); } - internal static PackageInputPathId DeserializePackageInputPathId(JsonElement element, ModelReaderWriterOptions options = null) + internal static RaiBlocklistConfig DeserializeRaiBlocklistConfig(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +74,24 @@ internal static PackageInputPathId DeserializePackageInputPathId(JsonElement ele { return null; } - ResourceIdentifier resourceId = default; - InputPathType inputPathType = default; + bool? blocking = default; + string blocklistName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceId"u8)) + if (property.NameEquals("blocking"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - resourceId = null; continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + blocking = property.Value.GetBoolean(); continue; } - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("blocklistName"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + blocklistName = property.Value.GetString(); continue; } if (options.Format != "W") @@ -105,38 +100,38 @@ internal static PackageInputPathId DeserializePackageInputPathId(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new PackageInputPathId(inputPathType, serializedAdditionalRawData, resourceId); + return new RaiBlocklistConfig(blocking, blocklistName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{options.Format}' format."); } } - PackageInputPathId IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RaiBlocklistConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathId(document.RootElement, options); + return DeserializeRaiBlocklistConfig(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathId)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs new file mode 100644 index 0000000000000..83e1be0f35feb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI blocklist config. + public partial class RaiBlocklistConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistConfig() + { + } + + /// Initializes a new instance of . + /// If blocking would occur. + /// Name of ContentFilter. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistConfig(bool? blocking, string blocklistName, IDictionary serializedAdditionalRawData) + { + Blocking = blocking; + BlocklistName = blocklistName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If blocking would occur. + public bool? Blocking { get; set; } + /// Name of ContentFilter. + public string BlocklistName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs new file mode 100644 index 0000000000000..23dade87b9638 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiBlocklistItemBulkRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemBulkRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemBulkRequest(document.RootElement, options); + } + + internal static RaiBlocklistItemBulkRequest DeserializeRaiBlocklistItemBulkRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + RaiBlocklistItemProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = RaiBlocklistItemProperties.DeserializeRaiBlocklistItemProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemBulkRequest(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemBulkRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemBulkRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs new file mode 100644 index 0000000000000..b29c159c5854d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The Cognitive Services RaiBlocklist Item request body. + public partial class RaiBlocklistItemBulkRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistItemBulkRequest() + { + } + + /// Initializes a new instance of . + /// + /// Properties of Cognitive Services RaiBlocklist Item. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemBulkRequest(string name, RaiBlocklistItemProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the name. + public string Name { get; set; } + /// Properties of Cognitive Services RaiBlocklist Item. + public RaiBlocklistItemProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs similarity index 61% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs index 8e8b847b24707..7f1f607d80f7f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobImageProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs @@ -13,26 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingJobImageProperties : IUtf8JsonSerializable, IJsonModel + public partial class RaiBlocklistItemProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(AnnotationType)) + if (Optional.IsDefined(IsRegex)) { - writer.WritePropertyName("annotationType"u8); - writer.WriteStringValue(AnnotationType.Value.ToString()); + writer.WritePropertyName("isRegex"u8); + writer.WriteBooleanValue(IsRegex.Value); + } + if (Optional.IsDefined(Pattern)) + { + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); } - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -51,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - LabelingJobImageProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RaiBlocklistItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobImageProperties(document.RootElement, options); + return DeserializeRaiBlocklistItemProperties(document.RootElement, options); } - internal static LabelingJobImageProperties DeserializeLabelingJobImageProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static RaiBlocklistItemProperties DeserializeRaiBlocklistItemProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,24 +74,24 @@ internal static LabelingJobImageProperties DeserializeLabelingJobImageProperties { return null; } - ImageAnnotationType? annotationType = default; - MediaType mediaType = default; + bool? isRegex = default; + string pattern = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("annotationType"u8)) + if (property.NameEquals("isRegex"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - annotationType = new ImageAnnotationType(property.Value.GetString()); + isRegex = property.Value.GetBoolean(); continue; } - if (property.NameEquals("mediaType"u8)) + if (property.NameEquals("pattern"u8)) { - mediaType = new MediaType(property.Value.GetString()); + pattern = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +100,38 @@ internal static LabelingJobImageProperties DeserializeLabelingJobImageProperties } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobImageProperties(mediaType, serializedAdditionalRawData, annotationType); + return new RaiBlocklistItemProperties(isRegex, pattern, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support writing '{options.Format}' format."); } } - LabelingJobImageProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RaiBlocklistItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobImageProperties(document.RootElement, options); + return DeserializeRaiBlocklistItemProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobImageProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs new file mode 100644 index 0000000000000..73f38f3c677c4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// RAI Custom Blocklist Item properties. + public partial class RaiBlocklistItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistItemProperties() + { + } + + /// Initializes a new instance of . + /// If the pattern is a regex pattern. + /// Pattern to match against. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemProperties(bool? isRegex, string pattern, IDictionary serializedAdditionalRawData) + { + IsRegex = isRegex; + Pattern = pattern; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If the pattern is a regex pattern. + public bool? IsRegex { get; set; } + /// Pattern to match against. + public string Pattern { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..b0cfc60cff313 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..44ebeba3ee013 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. + internal partial class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs index 34e84a4dc0438..13ba791cccfe3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownLabelingJobMediaProperties : IUtf8JsonSerializable, IJsonModel + public partial class RaiBlocklistProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - LabelingJobMediaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RaiBlocklistProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); + return DeserializeRaiBlocklistProperties(document.RootElement, options); } - internal static UnknownLabelingJobMediaProperties DeserializeUnknownLabelingJobMediaProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static RaiBlocklistProperties DeserializeRaiBlocklistProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static UnknownLabelingJobMediaProperties DeserializeUnknownLabelingJobM { return null; } - MediaType mediaType = "Unknown"; + string description = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mediaType"u8)) + if (property.NameEquals("description"u8)) { - mediaType = new MediaType(property.Value.GetString()); + description = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static UnknownLabelingJobMediaProperties DeserializeUnknownLabelingJobM } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownLabelingJobMediaProperties(mediaType, serializedAdditionalRawData); + return new RaiBlocklistProperties(description, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support writing '{options.Format}' format."); } } - LabelingJobMediaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RaiBlocklistProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobMediaProperties(document.RootElement, options); + return DeserializeRaiBlocklistProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobMediaProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs new file mode 100644 index 0000000000000..616e6f5311a22 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// RAI Custom Blocklist properties. + public partial class RaiBlocklistProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistProperties() + { + } + + /// Initializes a new instance of . + /// Description of the block list. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistProperties(string description, IDictionary serializedAdditionalRawData) + { + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Description of the block list. + public string Description { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..bcaa0b6f547bd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiBlocklistPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistPropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiBlocklistPropertiesBasicResourceArmPaginatedResult DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..79e77b0814ef0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RaiBlocklistPropertiesBasicResourceArmPaginatedResult. + internal partial class RaiBlocklistPropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RaiBlocklistPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs new file mode 100644 index 0000000000000..e10035dd34c97 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiPolicyContentFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AllowedContentLevel)) + { + writer.WritePropertyName("allowedContentLevel"u8); + writer.WriteStringValue(AllowedContentLevel.Value.ToString()); + } + if (Optional.IsDefined(Blocking)) + { + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyContentFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyContentFilter(document.RootElement, options); + } + + internal static RaiPolicyContentFilter DeserializeRaiPolicyContentFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AllowedContentLevel? allowedContentLevel = default; + bool? blocking = default; + bool? enabled = default; + string name = default; + RaiPolicyContentSource? source = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowedContentLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowedContentLevel = new AllowedContentLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("blocking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blocking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = new RaiPolicyContentSource(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyContentFilter( + allowedContentLevel, + blocking, + enabled, + name, + source, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyContentFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyContentFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs new file mode 100644 index 0000000000000..7f552a2bd1456 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filter. + public partial class RaiPolicyContentFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiPolicyContentFilter() + { + } + + /// Initializes a new instance of . + /// Level at which content is filtered. + /// If blocking would occur. + /// If the ContentFilter is enabled. + /// Name of ContentFilter. + /// Content source to apply the Content Filters. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyContentFilter(AllowedContentLevel? allowedContentLevel, bool? blocking, bool? enabled, string name, RaiPolicyContentSource? source, IDictionary serializedAdditionalRawData) + { + AllowedContentLevel = allowedContentLevel; + Blocking = blocking; + Enabled = enabled; + Name = name; + Source = source; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Level at which content is filtered. + public AllowedContentLevel? AllowedContentLevel { get; set; } + /// If blocking would occur. + public bool? Blocking { get; set; } + /// If the ContentFilter is enabled. + public bool? Enabled { get; set; } + /// Name of ContentFilter. + public string Name { get; set; } + /// Content source to apply the Content Filters. + public RaiPolicyContentSource? Source { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs new file mode 100644 index 0000000000000..bda93bfeeb39c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content source to apply the Content Filters. + public readonly partial struct RaiPolicyContentSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyContentSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PromptValue = "Prompt"; + private const string CompletionValue = "Completion"; + + /// Prompt. + public static RaiPolicyContentSource Prompt { get; } = new RaiPolicyContentSource(PromptValue); + /// Completion. + public static RaiPolicyContentSource Completion { get; } = new RaiPolicyContentSource(CompletionValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyContentSource left, RaiPolicyContentSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyContentSource left, RaiPolicyContentSource right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyContentSource(string value) => new RaiPolicyContentSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyContentSource other && Equals(other); + /// + public bool Equals(RaiPolicyContentSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs new file mode 100644 index 0000000000000..2a627aafe4adf --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content Filters mode. + public readonly partial struct RaiPolicyMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string DeferredValue = "Deferred"; + private const string BlockingValue = "Blocking"; + + /// Default. + public static RaiPolicyMode Default { get; } = new RaiPolicyMode(DefaultValue); + /// Deferred. + public static RaiPolicyMode Deferred { get; } = new RaiPolicyMode(DeferredValue); + /// Blocking. + public static RaiPolicyMode Blocking { get; } = new RaiPolicyMode(BlockingValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyMode left, RaiPolicyMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyMode left, RaiPolicyMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyMode(string value) => new RaiPolicyMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyMode other && Equals(other); + /// + public bool Equals(RaiPolicyMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs new file mode 100644 index 0000000000000..dbd6ff6d29453 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiPolicyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BasePolicyName)) + { + writer.WritePropertyName("basePolicyName"u8); + writer.WriteStringValue(BasePolicyName); + } + if (Optional.IsCollectionDefined(CompletionBlocklists)) + { + writer.WritePropertyName("completionBlocklists"u8); + writer.WriteStartArray(); + foreach (var item in CompletionBlocklists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ContentFilters)) + { + writer.WritePropertyName("contentFilters"u8); + writer.WriteStartArray(); + foreach (var item in ContentFilters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsCollectionDefined(PromptBlocklists)) + { + writer.WritePropertyName("promptBlocklists"u8); + writer.WriteStartArray(); + foreach (var item in PromptBlocklists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PolicyType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PolicyType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyProperties(document.RootElement, options); + } + + internal static RaiPolicyProperties DeserializeRaiPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string basePolicyName = default; + IList completionBlocklists = default; + IList contentFilters = default; + RaiPolicyMode? mode = default; + IList promptBlocklists = default; + RaiPolicyType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("basePolicyName"u8)) + { + basePolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("completionBlocklists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistConfig.DeserializeRaiBlocklistConfig(item, options)); + } + completionBlocklists = array; + continue; + } + if (property.NameEquals("contentFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiPolicyContentFilter.DeserializeRaiPolicyContentFilter(item, options)); + } + contentFilters = array; + continue; + } + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new RaiPolicyMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("promptBlocklists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistConfig.DeserializeRaiBlocklistConfig(item, options)); + } + promptBlocklists = array; + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new RaiPolicyType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyProperties( + basePolicyName, + completionBlocklists ?? new ChangeTrackingList(), + contentFilters ?? new ChangeTrackingList(), + mode, + promptBlocklists ?? new ChangeTrackingList(), + type, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs new file mode 100644 index 0000000000000..051f56aa0aef9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filters properties. + public partial class RaiPolicyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiPolicyProperties() + { + CompletionBlocklists = new ChangeTrackingList(); + ContentFilters = new ChangeTrackingList(); + PromptBlocklists = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the base Content Filters. + /// + /// + /// Content Filters mode. + /// + /// Content Filters policy type. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyProperties(string basePolicyName, IList completionBlocklists, IList contentFilters, RaiPolicyMode? mode, IList promptBlocklists, RaiPolicyType? policyType, IDictionary serializedAdditionalRawData) + { + BasePolicyName = basePolicyName; + CompletionBlocklists = completionBlocklists; + ContentFilters = contentFilters; + Mode = mode; + PromptBlocklists = promptBlocklists; + PolicyType = policyType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the base Content Filters. + public string BasePolicyName { get; set; } + /// Gets the completion blocklists. + public IList CompletionBlocklists { get; } + /// Gets the content filters. + public IList ContentFilters { get; } + /// Content Filters mode. + public RaiPolicyMode? Mode { get; set; } + /// Gets the prompt blocklists. + public IList PromptBlocklists { get; } + /// Content Filters policy type. + public RaiPolicyType? PolicyType { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..5b9391b3a2208 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiPolicyPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyPropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiPolicyPropertiesBasicResourceArmPaginatedResult DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 0000000000000..7085d0e21698b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filters resource list. + internal partial class RaiPolicyPropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RaiPolicyPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiPolicyPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs new file mode 100644 index 0000000000000..1c9f489932e26 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content Filters policy type. + public readonly partial struct RaiPolicyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserManagedValue = "UserManaged"; + private const string SystemManagedValue = "SystemManaged"; + + /// UserManaged. + public static RaiPolicyType UserManaged { get; } = new RaiPolicyType(UserManagedValue); + /// SystemManaged. + public static RaiPolicyType SystemManaged { get; } = new RaiPolicyType(SystemManagedValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyType left, RaiPolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyType left, RaiPolicyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyType(string value) => new RaiPolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyType other && Equals(other); + /// + public bool Equals(RaiPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs index 756b40e47aa96..da96a39ca4c31 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs @@ -26,18 +26,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(Logbase)) - { - if (Logbase != null) - { - writer.WritePropertyName("logbase"u8); - writer.WriteStringValue(Logbase); - } - else - { - writer.WriteNull("logbase"); - } - } if (Optional.IsDefined(Rule)) { writer.WritePropertyName("rule"u8); @@ -95,7 +83,6 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE { return null; } - string logbase = default; RandomSamplingAlgorithmRule? rule = default; int? seed = default; SamplingAlgorithmType samplingAlgorithmType = default; @@ -103,16 +90,6 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("logbase"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - logbase = null; - continue; - } - logbase = property.Value.GetString(); - continue; - } if (property.NameEquals("rule"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +120,7 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new RandomSamplingAlgorithm(samplingAlgorithmType, serializedAdditionalRawData, logbase, rule, seed); + return new RandomSamplingAlgorithm(samplingAlgorithmType, serializedAdditionalRawData, rule, seed); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs index f2f2c323ba796..cc0c965c2faae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs @@ -22,19 +22,15 @@ public RandomSamplingAlgorithm() /// Initializes a new instance of . /// [Required] The algorithm used for generating hyperparameter values, along with configuration properties. /// Keeps track of any properties unknown to the library. - /// An optional positive number or e in string format to be used as base for log based random sampling. /// The specific type of random algorithm. /// An optional integer to use as the seed for random number generation. - internal RandomSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithmType, IDictionary serializedAdditionalRawData, string logbase, RandomSamplingAlgorithmRule? rule, int? seed) : base(samplingAlgorithmType, serializedAdditionalRawData) + internal RandomSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithmType, IDictionary serializedAdditionalRawData, RandomSamplingAlgorithmRule? rule, int? seed) : base(samplingAlgorithmType, serializedAdditionalRawData) { - Logbase = logbase; Rule = rule; Seed = seed; SamplingAlgorithmType = samplingAlgorithmType; } - /// An optional positive number or e in string format to be used as base for log based random sampling. - public string Logbase { get; set; } /// The specific type of random algorithm. public RandomSamplingAlgorithmRule? Rule { get; set; } /// An optional integer to use as the seed for random number generation. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs deleted file mode 100644 index 71ceff665cebc..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class RayDistributionConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Address)) - { - if (Address != null) - { - writer.WritePropertyName("address"u8); - writer.WriteStringValue(Address); - } - else - { - writer.WriteNull("address"); - } - } - if (Optional.IsDefined(DashboardPort)) - { - if (DashboardPort != null) - { - writer.WritePropertyName("dashboardPort"u8); - writer.WriteNumberValue(DashboardPort.Value); - } - else - { - writer.WriteNull("dashboardPort"); - } - } - if (Optional.IsDefined(HeadNodeAdditionalArgs)) - { - if (HeadNodeAdditionalArgs != null) - { - writer.WritePropertyName("headNodeAdditionalArgs"u8); - writer.WriteStringValue(HeadNodeAdditionalArgs); - } - else - { - writer.WriteNull("headNodeAdditionalArgs"); - } - } - if (Optional.IsDefined(IncludeDashboard)) - { - if (IncludeDashboard != null) - { - writer.WritePropertyName("includeDashboard"u8); - writer.WriteBooleanValue(IncludeDashboard.Value); - } - else - { - writer.WriteNull("includeDashboard"); - } - } - if (Optional.IsDefined(Port)) - { - if (Port != null) - { - writer.WritePropertyName("port"u8); - writer.WriteNumberValue(Port.Value); - } - else - { - writer.WriteNull("port"); - } - } - if (Optional.IsDefined(WorkerNodeAdditionalArgs)) - { - if (WorkerNodeAdditionalArgs != null) - { - writer.WritePropertyName("workerNodeAdditionalArgs"u8); - writer.WriteStringValue(WorkerNodeAdditionalArgs); - } - else - { - writer.WriteNull("workerNodeAdditionalArgs"); - } - } - writer.WritePropertyName("distributionType"u8); - writer.WriteStringValue(DistributionType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RayDistributionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRayDistributionConfiguration(document.RootElement, options); - } - - internal static RayDistributionConfiguration DeserializeRayDistributionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string address = default; - int? dashboardPort = default; - string headNodeAdditionalArgs = default; - bool? includeDashboard = default; - int? port = default; - string workerNodeAdditionalArgs = default; - DistributionType distributionType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("address"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - address = null; - continue; - } - address = property.Value.GetString(); - continue; - } - if (property.NameEquals("dashboardPort"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - dashboardPort = null; - continue; - } - dashboardPort = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("headNodeAdditionalArgs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - headNodeAdditionalArgs = null; - continue; - } - headNodeAdditionalArgs = property.Value.GetString(); - continue; - } - if (property.NameEquals("includeDashboard"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - includeDashboard = null; - continue; - } - includeDashboard = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("port"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - port = null; - continue; - } - port = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("workerNodeAdditionalArgs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - workerNodeAdditionalArgs = null; - continue; - } - workerNodeAdditionalArgs = property.Value.GetString(); - continue; - } - if (property.NameEquals("distributionType"u8)) - { - distributionType = new DistributionType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RayDistributionConfiguration( - distributionType, - serializedAdditionalRawData, - address, - dashboardPort, - headNodeAdditionalArgs, - includeDashboard, - port, - workerNodeAdditionalArgs); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support writing '{options.Format}' format."); - } - } - - RayDistributionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRayDistributionConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RayDistributionConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs deleted file mode 100644 index ca0e99714bec9..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RayDistributionConfiguration.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Ray distribution configuration. - public partial class RayDistributionConfiguration : MachineLearningDistributionConfiguration - { - /// Initializes a new instance of . - public RayDistributionConfiguration() - { - DistributionType = DistributionType.Ray; - } - - /// Initializes a new instance of . - /// [Required] Specifies the type of distribution framework. - /// Keeps track of any properties unknown to the library. - /// The address of Ray head node. - /// The port to bind the dashboard server to. - /// Additional arguments passed to ray start in head node. - /// Provide this argument to start the Ray dashboard GUI. - /// The port of the head ray process. - /// Additional arguments passed to ray start in worker node. - internal RayDistributionConfiguration(DistributionType distributionType, IDictionary serializedAdditionalRawData, string address, int? dashboardPort, string headNodeAdditionalArgs, bool? includeDashboard, int? port, string workerNodeAdditionalArgs) : base(distributionType, serializedAdditionalRawData) - { - Address = address; - DashboardPort = dashboardPort; - HeadNodeAdditionalArgs = headNodeAdditionalArgs; - IncludeDashboard = includeDashboard; - Port = port; - WorkerNodeAdditionalArgs = workerNodeAdditionalArgs; - DistributionType = distributionType; - } - - /// The address of Ray head node. - public string Address { get; set; } - /// The port to bind the dashboard server to. - public int? DashboardPort { get; set; } - /// Additional arguments passed to ray start in head node. - public string HeadNodeAdditionalArgs { get; set; } - /// Provide this argument to start the Ray dashboard GUI. - public bool? IncludeDashboard { get; set; } - /// The port of the head ray process. - public int? Port { get; set; } - /// Additional arguments passed to ray start in worker node. - public string WorkerNodeAdditionalArgs { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs similarity index 58% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs index 76d7c151968ee..8d991ab0329e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownMLAssistConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class RegenerateServiceAccountKeyContent : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); + if (Optional.IsDefined(KeyName)) + { + writer.WritePropertyName("keyName"u8); + writer.WriteStringValue(KeyName.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - MachineLearningAssistConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RegenerateServiceAccountKeyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); + return DeserializeRegenerateServiceAccountKeyContent(document.RootElement, options); } - internal static UnknownMLAssistConfiguration DeserializeUnknownMLAssistConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static RegenerateServiceAccountKeyContent DeserializeRegenerateServiceAccountKeyContent(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,18 @@ internal static UnknownMLAssistConfiguration DeserializeUnknownMLAssistConfigura { return null; } - MLAssistConfigurationType mlAssist = "Unknown"; + ServiceAccountKeyName? keyName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mlAssist"u8)) + if (property.NameEquals("keyName"u8)) { - mlAssist = new MLAssistConfigurationType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyName = new ServiceAccountKeyName(property.Value.GetString()); continue; } if (options.Format != "W") @@ -82,38 +89,38 @@ internal static UnknownMLAssistConfiguration DeserializeUnknownMLAssistConfigura } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownMLAssistConfiguration(mlAssist, serializedAdditionalRawData); + return new RegenerateServiceAccountKeyContent(keyName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support writing '{options.Format}' format."); } } - MachineLearningAssistConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RegenerateServiceAccountKeyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningAssistConfiguration(document.RootElement, options); + return DeserializeRegenerateServiceAccountKeyContent(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MachineLearningAssistConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs new file mode 100644 index 0000000000000..a4d96f697c97b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RegenerateServiceAccountKeyContent. + public partial class RegenerateServiceAccountKeyContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RegenerateServiceAccountKeyContent() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal RegenerateServiceAccountKeyContent(ServiceAccountKeyName? keyName, IDictionary serializedAdditionalRawData) + { + KeyName = keyName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key name. + public ServiceAccountKeyName? KeyName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs index 0d1d1d58e8fc6..c017ebc19c377 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryAcrDetails.cs @@ -53,7 +53,7 @@ public RegistryAcrDetails() /// Initializes a new instance of . /// Details of system created ACR account to be used for the Registry. - /// Details of user created ACR account to be used for the Registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created ACR account to be used for the Registry. /// Keeps track of any properties unknown to the library. internal RegistryAcrDetails(SystemCreatedAcrAccount systemCreatedAcrAccount, UserCreatedAcrAccount userCreatedAcrAccount, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal RegistryAcrDetails(SystemCreatedAcrAccount systemCreatedAcrAccount, Use /// Details of system created ACR account to be used for the Registry. public SystemCreatedAcrAccount SystemCreatedAcrAccount { get; set; } - /// Details of user created ACR account to be used for the Registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created ACR account to be used for the Registry. internal UserCreatedAcrAccount UserCreatedAcrAccount { get; set; } /// /// Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs index 04c79ad19b697..9608d93540544 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.Serialization.cs @@ -81,16 +81,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("privateEndpoint"); } } - if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + if (Optional.IsDefined(RegistryPrivateLinkServiceConnectionState)) { - if (PrivateLinkServiceConnectionState != null) + if (RegistryPrivateLinkServiceConnectionState != null) { - writer.WritePropertyName("privateLinkServiceConnectionState"u8); - writer.WriteObjectValue(PrivateLinkServiceConnectionState, options); + writer.WritePropertyName("registryPrivateLinkServiceConnectionState"u8); + writer.WriteObjectValue(RegistryPrivateLinkServiceConnectionState, options); } else { - writer.WriteNull("privateLinkServiceConnectionState"); + writer.WriteNull("registryPrivateLinkServiceConnectionState"); } } if (Optional.IsDefined(ProvisioningState)) @@ -148,7 +148,7 @@ internal static RegistryPrivateEndpointConnection DeserializeRegistryPrivateEndp AzureLocation? location = default; IList groupIds = default; RegistryPrivateEndpoint privateEndpoint = default; - RegistryPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState = default; string provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -208,14 +208,14 @@ internal static RegistryPrivateEndpointConnection DeserializeRegistryPrivateEndp privateEndpoint = RegistryPrivateEndpoint.DeserializeRegistryPrivateEndpoint(property0.Value, options); continue; } - if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + if (property0.NameEquals("registryPrivateLinkServiceConnectionState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { - privateLinkServiceConnectionState = null; + registryPrivateLinkServiceConnectionState = null; continue; } - privateLinkServiceConnectionState = RegistryPrivateLinkServiceConnectionState.DeserializeRegistryPrivateLinkServiceConnectionState(property0.Value, options); + registryPrivateLinkServiceConnectionState = RegistryPrivateLinkServiceConnectionState.DeserializeRegistryPrivateLinkServiceConnectionState(property0.Value, options); continue; } if (property0.NameEquals("provisioningState"u8)) @@ -242,7 +242,7 @@ internal static RegistryPrivateEndpointConnection DeserializeRegistryPrivateEndp location, groupIds ?? new ChangeTrackingList(), privateEndpoint, - privateLinkServiceConnectionState, + registryPrivateLinkServiceConnectionState, provisioningState, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs index e27f21db02757..cb96f9ef2eb71 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegistryPrivateEndpointConnection.cs @@ -55,28 +55,28 @@ public RegistryPrivateEndpointConnection() /// Initializes a new instance of . /// /// This is the private endpoint connection name created on SRP - /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName} + /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName} /// /// Same as workspace location. /// The group ids. /// The PE network resource that is linked to this PE connection. - /// The connection state. + /// The connection state. /// One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. /// Keeps track of any properties unknown to the library. - internal RegistryPrivateEndpointConnection(ResourceIdentifier id, AzureLocation? location, IList groupIds, RegistryPrivateEndpoint privateEndpoint, RegistryPrivateLinkServiceConnectionState privateLinkServiceConnectionState, string provisioningState, IDictionary serializedAdditionalRawData) + internal RegistryPrivateEndpointConnection(ResourceIdentifier id, AzureLocation? location, IList groupIds, RegistryPrivateEndpoint privateEndpoint, RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState, string provisioningState, IDictionary serializedAdditionalRawData) { Id = id; Location = location; GroupIds = groupIds; PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + RegistryPrivateLinkServiceConnectionState = registryPrivateLinkServiceConnectionState; ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } /// /// This is the private endpoint connection name created on SRP - /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/privateEndpointConnections/{peConnectionName} + /// Full resource id: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName} /// public ResourceIdentifier Id { get; set; } /// Same as workspace location. @@ -86,7 +86,7 @@ internal RegistryPrivateEndpointConnection(ResourceIdentifier id, AzureLocation? /// The PE network resource that is linked to this PE connection. public RegistryPrivateEndpoint PrivateEndpoint { get; set; } /// The connection state. - public RegistryPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + public RegistryPrivateLinkServiceConnectionState RegistryPrivateLinkServiceConnectionState { get; set; } /// One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. public string ProvisioningState { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs deleted file mode 100644 index f214114f7630a..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetric.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The RegressionModelPerformanceMetric. - public readonly partial struct RegressionModelPerformanceMetric : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RegressionModelPerformanceMetric(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string MeanAbsoluteErrorValue = "MeanAbsoluteError"; - private const string RootMeanSquaredErrorValue = "RootMeanSquaredError"; - private const string MeanSquaredErrorValue = "MeanSquaredError"; - - /// The Mean Absolute Error (MAE) metric. - public static RegressionModelPerformanceMetric MeanAbsoluteError { get; } = new RegressionModelPerformanceMetric(MeanAbsoluteErrorValue); - /// The Root Mean Squared Error (RMSE) metric. - public static RegressionModelPerformanceMetric RootMeanSquaredError { get; } = new RegressionModelPerformanceMetric(RootMeanSquaredErrorValue); - /// The Mean Squared Error (MSE) metric. - public static RegressionModelPerformanceMetric MeanSquaredError { get; } = new RegressionModelPerformanceMetric(MeanSquaredErrorValue); - /// Determines if two values are the same. - public static bool operator ==(RegressionModelPerformanceMetric left, RegressionModelPerformanceMetric right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RegressionModelPerformanceMetric left, RegressionModelPerformanceMetric right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RegressionModelPerformanceMetric(string value) => new RegressionModelPerformanceMetric(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RegressionModelPerformanceMetric other && Equals(other); - /// - public bool Equals(RegressionModelPerformanceMetric other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs deleted file mode 100644 index 26b939ebda5eb..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.Serialization.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class RegressionModelPerformanceMetricThreshold : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("metric"u8); - writer.WriteStringValue(Metric.ToString()); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) - { - if (Threshold != null) - { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RegressionModelPerformanceMetricThreshold IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRegressionModelPerformanceMetricThreshold(document.RootElement, options); - } - - internal static RegressionModelPerformanceMetricThreshold DeserializeRegressionModelPerformanceMetricThreshold(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RegressionModelPerformanceMetric metric = default; - MonitoringModelType modelType = default; - MonitoringThreshold threshold = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metric"u8)) - { - metric = new RegressionModelPerformanceMetric(property.Value.GetString()); - continue; - } - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - threshold = null; - continue; - } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RegressionModelPerformanceMetricThreshold(modelType, threshold, serializedAdditionalRawData, metric); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support writing '{options.Format}' format."); - } - } - - RegressionModelPerformanceMetricThreshold IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRegressionModelPerformanceMetricThreshold(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RegressionModelPerformanceMetricThreshold)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs deleted file mode 100644 index 127589b7c7d4b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionModelPerformanceMetricThreshold.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The RegressionModelPerformanceMetricThreshold. - public partial class RegressionModelPerformanceMetricThreshold : ModelPerformanceMetricThresholdBase - { - /// Initializes a new instance of . - /// [Required] The regression model performance metric to calculate. - public RegressionModelPerformanceMetricThreshold(RegressionModelPerformanceMetric metric) - { - Metric = metric; - ModelType = MonitoringModelType.Regression; - } - - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - /// [Required] The regression model performance metric to calculate. - internal RegressionModelPerformanceMetricThreshold(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData, RegressionModelPerformanceMetric metric) : base(modelType, threshold, serializedAdditionalRawData) - { - Metric = metric; - ModelType = modelType; - } - - /// Initializes a new instance of for deserialization. - internal RegressionModelPerformanceMetricThreshold() - { - } - - /// [Required] The regression model performance metric to calculate. - public RegressionModelPerformanceMetric Metric { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs index 209108e3139d0..72329643c50f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs @@ -102,11 +102,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("stackEnsembleSettings"); } } - if (Optional.IsDefined(TrainingMode)) - { - writer.WritePropertyName("trainingMode"u8); - writer.WriteStringValue(TrainingMode.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -154,7 +149,6 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; MachineLearningStackEnsembleSettings stackEnsembleSettings = default; - TrainingMode? trainingMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -253,15 +247,6 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings stackEnsembleSettings = MachineLearningStackEnsembleSettings.DeserializeMachineLearningStackEnsembleSettings(property.Value, options); continue; } - if (property.NameEquals("trainingMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - trainingMode = new TrainingMode(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -276,7 +261,6 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings enableVoteEnsemble, ensembleModelDownloadTimeout, stackEnsembleSettings, - trainingMode, serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs index b619cfb4ada3e..05f8f2bf88839 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs @@ -31,15 +31,10 @@ public RegressionTrainingSettings() /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// /// Stack ensemble settings for stack ensemble run. - /// - /// TrainingMode mode - Setting to 'auto' is same as setting it to 'non-distributed' for now, however in the future may result in mixed mode or heuristics based mode selection. Default is 'auto'. - /// If 'Distributed' then only distributed featurization is used and distributed algorithms are chosen. - /// If 'NonDistributed' then only non distributed algorithms are chosen. - /// /// Keeps track of any properties unknown to the library. /// Allowed models for regression task. /// Blocked models for regression task. - internal RegressionTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, TrainingMode? trainingMode, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, trainingMode, serializedAdditionalRawData) + internal RegressionTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs index f76372c4a651d..8f3648662266d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownPackageInputPathBase : IUtf8JsonSerializable, IJsonModel + public partial class ResizeSchema : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); + if (Optional.IsDefined(TargetVmSize)) + { + writer.WritePropertyName("targetVMSize"u8); + writer.WriteStringValue(TargetVmSize); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - PackageInputPathBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ResizeSchema IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathBase(document.RootElement, options); + return DeserializeResizeSchema(document.RootElement, options); } - internal static UnknownPackageInputPathBase DeserializeUnknownPackageInputPathBase(JsonElement element, ModelReaderWriterOptions options = null) + internal static ResizeSchema DeserializeResizeSchema(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static UnknownPackageInputPathBase DeserializeUnknownPackageInputPathBa { return null; } - InputPathType inputPathType = "Unknown"; + string targetVmSize = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("targetVMSize"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + targetVmSize = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static UnknownPackageInputPathBase DeserializeUnknownPackageInputPathBa } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownPackageInputPathBase(inputPathType, serializedAdditionalRawData); + return new ResizeSchema(targetVmSize, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support writing '{options.Format}' format."); } } - PackageInputPathBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ResizeSchema IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathBase(document.RootElement, options); + return DeserializeResizeSchema(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathBase)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResizeSchema)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs new file mode 100644 index 0000000000000..be33ee73ef451 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Schema for Compute Instance resize. + public partial class ResizeSchema + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ResizeSchema() + { + } + + /// Initializes a new instance of . + /// The name of the virtual machine size. + /// Keeps track of any properties unknown to the library. + internal ResizeSchema(string targetVmSize, IDictionary serializedAdditionalRawData) + { + TargetVmSize = targetVmSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the virtual machine size. + public string TargetVmSize { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs similarity index 81% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs index 96b8cd971bf52..b428af659a974 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class TrailingInputData : IUtf8JsonSerializable, IJsonModel + public partial class RollingInputData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrailingInputData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -96,19 +96,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - TrailingInputData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RollingInputData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrailingInputData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrailingInputData(document.RootElement, options); + return DeserializeRollingInputData(document.RootElement, options); } - internal static TrailingInputData DeserializeTrailingInputData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RollingInputData DeserializeRollingInputData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -194,7 +194,7 @@ internal static TrailingInputData DeserializeTrailingInputData(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new TrailingInputData( + return new RollingInputData( columns ?? new ChangeTrackingDictionary(), dataContext, inputDataType, @@ -206,35 +206,35 @@ internal static TrailingInputData DeserializeTrailingInputData(JsonElement eleme windowSize); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrailingInputData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support writing '{options.Format}' format."); } } - TrailingInputData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RollingInputData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrailingInputData(document.RootElement, options); + return DeserializeRollingInputData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrailingInputData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RollingInputData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs index 592914fb6666c..119e830fadadc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrailingInputData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs @@ -10,35 +10,35 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Trailing input data definition. - public partial class TrailingInputData : MonitoringInputDataBase + /// Rolling input data definition. + public partial class RollingInputData : MonitoringInputDataBase { - /// Initializes a new instance of . + /// Initializes a new instance of . /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// [Required] The time offset between the end of the data window and the monitor's current run time. - /// [Required] The size of the trailing data window. + /// [Required] The size of the rolling data window. /// is null. - public TrailingInputData(JobInputType jobInputType, Uri uri, TimeSpan windowOffset, TimeSpan windowSize) : base(jobInputType, uri) + public RollingInputData(JobInputType jobInputType, Uri uri, TimeSpan windowOffset, TimeSpan windowSize) : base(jobInputType, uri) { Argument.AssertNotNull(uri, nameof(uri)); WindowOffset = windowOffset; WindowSize = windowSize; - InputDataType = MonitoringInputDataType.Trailing; + InputDataType = MonitoringInputDataType.Rolling; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Mapping of column names to special uses. /// The context metadata of the data source. /// [Required] Specifies the type of signal to monitor. /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// Keeps track of any properties unknown to the library. - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. /// [Required] The time offset between the end of the data window and the monitor's current run time. - /// [Required] The size of the trailing data window. - internal TrailingInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, TimeSpan windowOffset, TimeSpan windowSize) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) + /// [Required] The size of the rolling data window. + internal RollingInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, TimeSpan windowOffset, TimeSpan windowSize) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) { PreprocessingComponentId = preprocessingComponentId; WindowOffset = windowOffset; @@ -46,16 +46,16 @@ internal TrailingInputData(IDictionary columns, string dataConte InputDataType = inputDataType; } - /// Initializes a new instance of for deserialization. - internal TrailingInputData() + /// Initializes a new instance of for deserialization. + internal RollingInputData() { } - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. public string PreprocessingComponentId { get; set; } /// [Required] The time offset between the end of the data window and the monitor's current run time. public TimeSpan WindowOffset { get; set; } - /// [Required] The size of the trailing data window. + /// [Required] The size of the rolling data window. public TimeSpan WindowSize { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.Serialization.cs index 202c03fcb67d3..c16b7075364b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathUri.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.Serialization.cs @@ -13,33 +13,33 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class PackageInputPathUri : IUtf8JsonSerializable, IJsonModel + public partial class SasCredential : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(SasUri)) { - if (Uri != null) + if (SasUri != null) { - writer.WritePropertyName("url"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WritePropertyName("sasUri"u8); + writer.WriteStringValue(SasUri.AbsoluteUri); } else { - writer.WriteNull("url"); + writer.WriteNull("sasUri"); } } - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +58,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - PackageInputPathUri IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SasCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathUri(document.RootElement, options); + return DeserializeSasCredential(document.RootElement, options); } - internal static PackageInputPathUri DeserializePackageInputPathUri(JsonElement element, ModelReaderWriterOptions options = null) + internal static SasCredential DeserializeSasCredential(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +78,25 @@ internal static PackageInputPathUri DeserializePackageInputPathUri(JsonElement e { return null; } - Uri url = default; - InputPathType inputPathType = default; + Uri sasUri = default; + DataReferenceCredentialType credentialType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("url"u8)) + if (property.NameEquals("sasUri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - url = null; + sasUri = null; continue; } - url = new Uri(property.Value.GetString()); + sasUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("credentialType"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + credentialType = new DataReferenceCredentialType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,38 +105,38 @@ internal static PackageInputPathUri DeserializePackageInputPathUri(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new PackageInputPathUri(inputPathType, serializedAdditionalRawData, url); + return new SasCredential(credentialType, serializedAdditionalRawData, sasUri); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support writing '{options.Format}' format."); } } - PackageInputPathUri IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SasCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathUri(document.RootElement, options); + return DeserializeSasCredential(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathUri)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SasCredential)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs new file mode 100644 index 0000000000000..5e5cef9ed4e5b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SasCredential.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Access with full SAS uri. + public partial class SasCredential : DataReferenceCredential + { + /// Initializes a new instance of . + internal SasCredential() + { + CredentialType = DataReferenceCredentialType.Sas; + } + + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + /// Full SAS Uri, including the storage, container/blob path and SAS token. + internal SasCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, Uri sasUri) : base(credentialType, serializedAdditionalRawData) + { + SasUri = sasUri; + CredentialType = credentialType; + } + + /// Full SAS Uri, including the storage, container/blob path and SAS token. + public Uri SasUri { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs index ec6173543186b..a780d1dbe21df 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ScheduleActionType.cs @@ -24,15 +24,12 @@ public ScheduleActionType(string value) private const string CreateJobValue = "CreateJob"; private const string InvokeBatchEndpointValue = "InvokeBatchEndpoint"; - private const string ImportDataValue = "ImportData"; private const string CreateMonitorValue = "CreateMonitor"; /// CreateJob. public static ScheduleActionType CreateJob { get; } = new ScheduleActionType(CreateJobValue); /// InvokeBatchEndpoint. public static ScheduleActionType InvokeBatchEndpoint { get; } = new ScheduleActionType(InvokeBatchEndpointValue); - /// ImportData. - public static ScheduleActionType ImportData { get; } = new ScheduleActionType(ImportDataValue); /// CreateMonitor. public static ScheduleActionType CreateMonitor { get; } = new ScheduleActionType(CreateMonitorValue); /// Determines if two values are the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs index 03691de2af90a..309ee71ea33a1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoDeleteSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs @@ -13,35 +13,28 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class AutoDeleteSetting : IUtf8JsonSerializable, IJsonModel + public partial class SecretExpiry : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Condition)) + if (Optional.IsDefined(ExpirableSecret)) { - writer.WritePropertyName("condition"u8); - writer.WriteStringValue(Condition.Value.ToString()); + writer.WritePropertyName("expirableSecret"u8); + writer.WriteBooleanValue(ExpirableSecret.Value); } - if (Optional.IsDefined(Value)) + if (Optional.IsDefined(ExpireAfterHours)) { - if (Value != null) - { - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - } - else - { - writer.WriteNull("value"); - } + writer.WritePropertyName("expireAfterHours"u8); + writer.WriteNumberValue(ExpireAfterHours.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - AutoDeleteSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SecretExpiry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAutoDeleteSetting(document.RootElement, options); + return DeserializeSecretExpiry(document.RootElement, options); } - internal static AutoDeleteSetting DeserializeAutoDeleteSetting(JsonElement element, ModelReaderWriterOptions options = null) + internal static SecretExpiry DeserializeSecretExpiry(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,29 +74,28 @@ internal static AutoDeleteSetting DeserializeAutoDeleteSetting(JsonElement eleme { return null; } - AutoDeleteCondition? condition = default; - string value = default; + bool? expirableSecret = default; + int? expireAfterHours = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("condition"u8)) + if (property.NameEquals("expirableSecret"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - condition = new AutoDeleteCondition(property.Value.GetString()); + expirableSecret = property.Value.GetBoolean(); continue; } - if (property.NameEquals("value"u8)) + if (property.NameEquals("expireAfterHours"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - value = null; continue; } - value = property.Value.GetString(); + expireAfterHours = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -112,38 +104,38 @@ internal static AutoDeleteSetting DeserializeAutoDeleteSetting(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new AutoDeleteSetting(condition, value, serializedAdditionalRawData); + return new SecretExpiry(expirableSecret, expireAfterHours, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support writing '{options.Format}' format."); } } - AutoDeleteSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SecretExpiry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAutoDeleteSetting(document.RootElement, options); + return DeserializeSecretExpiry(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AutoDeleteSetting)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SecretExpiry)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs similarity index 66% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs index 653ce6f4bf72e..cdb6e2f1079ce 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Secret Configuration definition. - public partial class SecretConfiguration + /// Secret expiration configuration. + public partial class SecretExpiry { /// /// Keeps track of any properties unknown to the library. @@ -45,31 +45,25 @@ public partial class SecretConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public SecretConfiguration() + /// Initializes a new instance of . + public SecretExpiry() { } - /// Initializes a new instance of . - /// - /// Secret Uri. - /// Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion - /// - /// Name of secret in workspace key vault. + /// Initializes a new instance of . + /// Indicates if the secret is expirable. + /// Number of hours after which the secret will expire. /// Keeps track of any properties unknown to the library. - internal SecretConfiguration(Uri uri, string workspaceSecretName, IDictionary serializedAdditionalRawData) + internal SecretExpiry(bool? expirableSecret, int? expireAfterHours, IDictionary serializedAdditionalRawData) { - Uri = uri; - WorkspaceSecretName = workspaceSecretName; + ExpirableSecret = expirableSecret; + ExpireAfterHours = expireAfterHours; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// - /// Secret Uri. - /// Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion - /// - public Uri Uri { get; set; } - /// Name of secret in workspace key vault. - public string WorkspaceSecretName { get; set; } + /// Indicates if the secret is expirable. + public bool? ExpirableSecret { get; set; } + /// Number of hours after which the secret will expire. + public int? ExpireAfterHours { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs index 40057e6cef52f..d683296c8ca71 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretsType.cs @@ -26,8 +26,6 @@ public SecretsType(string value) private const string CertificateValue = "Certificate"; private const string SasValue = "Sas"; private const string ServicePrincipalValue = "ServicePrincipal"; - private const string KerberosPasswordValue = "KerberosPassword"; - private const string KerberosKeytabValue = "KerberosKeytab"; /// AccountKey. public static SecretsType AccountKey { get; } = new SecretsType(AccountKeyValue); @@ -37,10 +35,6 @@ public SecretsType(string value) public static SecretsType Sas { get; } = new SecretsType(SasValue); /// ServicePrincipal. public static SecretsType ServicePrincipal { get; } = new SecretsType(ServicePrincipalValue); - /// KerberosPassword. - public static SecretsType KerberosPassword { get; } = new SecretsType(KerberosPasswordValue); - /// KerberosKeytab. - public static SecretsType KerberosKeytab { get; } = new SecretsType(KerberosKeytabValue); /// Determines if two values are the same. public static bool operator ==(SecretsType left, SecretsType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs similarity index 56% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs index bc36506f08d5a..1004463adae25 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobTextProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs @@ -13,26 +13,29 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class LabelingJobTextProperties : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessComputeSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(AnnotationType)) + if (Optional.IsDefined(ServerlessComputeCustomSubnet)) { - writer.WritePropertyName("annotationType"u8); - writer.WriteStringValue(AnnotationType.Value.ToString()); + writer.WritePropertyName("serverlessComputeCustomSubnet"u8); + writer.WriteStringValue(ServerlessComputeCustomSubnet); + } + if (Optional.IsDefined(ServerlessComputeNoPublicIP)) + { + writer.WritePropertyName("serverlessComputeNoPublicIP"u8); + writer.WriteBooleanValue(ServerlessComputeNoPublicIP.Value); } - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -51,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - LabelingJobTextProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessComputeSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLabelingJobTextProperties(document.RootElement, options); + return DeserializeServerlessComputeSettings(document.RootElement, options); } - internal static LabelingJobTextProperties DeserializeLabelingJobTextProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessComputeSettings DeserializeServerlessComputeSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,24 +74,28 @@ internal static LabelingJobTextProperties DeserializeLabelingJobTextProperties(J { return null; } - TextAnnotationType? annotationType = default; - MediaType mediaType = default; + ResourceIdentifier serverlessComputeCustomSubnet = default; + bool? serverlessComputeNoPublicIP = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("annotationType"u8)) + if (property.NameEquals("serverlessComputeCustomSubnet"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - annotationType = new TextAnnotationType(property.Value.GetString()); + serverlessComputeCustomSubnet = new ResourceIdentifier(property.Value.GetString()); continue; } - if (property.NameEquals("mediaType"u8)) + if (property.NameEquals("serverlessComputeNoPublicIP"u8)) { - mediaType = new MediaType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeNoPublicIP = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -97,38 +104,38 @@ internal static LabelingJobTextProperties DeserializeLabelingJobTextProperties(J } } serializedAdditionalRawData = rawDataDictionary; - return new LabelingJobTextProperties(mediaType, serializedAdditionalRawData, annotationType); + return new ServerlessComputeSettings(serverlessComputeCustomSubnet, serverlessComputeNoPublicIP, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support writing '{options.Format}' format."); } } - LabelingJobTextProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessComputeSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLabelingJobTextProperties(document.RootElement, options); + return DeserializeServerlessComputeSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LabelingJobTextProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs new file mode 100644 index 0000000000000..c93ceed3f7189 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessComputeSettings. + public partial class ServerlessComputeSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ServerlessComputeSettings() + { + } + + /// Initializes a new instance of . + /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessComputeSettings(ResourceIdentifier serverlessComputeCustomSubnet, bool? serverlessComputeNoPublicIP, IDictionary serializedAdditionalRawData) + { + ServerlessComputeCustomSubnet = serverlessComputeCustomSubnet; + ServerlessComputeNoPublicIP = serverlessComputeNoPublicIP; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. + public ResourceIdentifier ServerlessComputeCustomSubnet { get; set; } + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + public bool? ServerlessComputeNoPublicIP { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs new file mode 100644 index 0000000000000..554e4ef639657 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointCapacityReservation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("capacityReservationGroupId"u8); + writer.WriteStringValue(CapacityReservationGroupId); + if (Optional.IsDefined(EndpointReservedCapacity)) + { + writer.WritePropertyName("endpointReservedCapacity"u8); + writer.WriteNumberValue(EndpointReservedCapacity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointCapacityReservation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointCapacityReservation(document.RootElement, options); + } + + internal static ServerlessEndpointCapacityReservation DeserializeServerlessEndpointCapacityReservation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string capacityReservationGroupId = default; + int? endpointReservedCapacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacityReservationGroupId"u8)) + { + capacityReservationGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointReservedCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointReservedCapacity = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointCapacityReservation(capacityReservationGroupId, endpointReservedCapacity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointCapacityReservation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointCapacityReservation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs similarity index 52% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs index f8f1962da25c1..98f81305c7224 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Azure Resource Manager resource envelope strictly used in update requests. - public partial class MachineLearningJobPatch + /// The ServerlessEndpointCapacityReservation. + public partial class ServerlessEndpointCapacityReservation { /// /// Keeps track of any properties unknown to the library. @@ -45,36 +45,35 @@ public partial class MachineLearningJobPatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MachineLearningJobPatch() + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointCapacityReservation(string capacityReservationGroupId) { + Argument.AssertNotNull(capacityReservationGroupId, nameof(capacityReservationGroupId)); + + CapacityReservationGroupId = capacityReservationGroupId; } - /// Initializes a new instance of . - /// Additional attributes of the entity. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal MachineLearningJobPatch(PartialJobBase properties, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointCapacityReservation(string capacityReservationGroupId, int? endpointReservedCapacity, IDictionary serializedAdditionalRawData) { - Properties = properties; + CapacityReservationGroupId = capacityReservationGroupId; + EndpointReservedCapacity = endpointReservedCapacity; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Additional attributes of the entity. - internal PartialJobBase Properties { get; set; } - /// - /// Send webhook callback to a service. Key is a user-provided name for the webhook. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public IDictionary NotificationSettingWebhooks + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointCapacityReservation() { - get => Properties is null ? default : Properties.NotificationSettingWebhooks; - set - { - if (Properties is null) - Properties = new PartialJobBase(); - Properties.NotificationSettingWebhooks = value; - } } + + /// Gets or sets the capacity reservation group id. + public string CapacityReservationGroupId { get; set; } + /// Gets or sets the endpoint reserved capacity. + public int? EndpointReservedCapacity { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs new file mode 100644 index 0000000000000..4aa4b25d79b85 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ServerlessEndpointContentSafety : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("contentSafetyStatus"u8); + writer.WriteStringValue(ContentSafetyStatus.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointContentSafety IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointContentSafety(document.RootElement, options); + } + + internal static ServerlessEndpointContentSafety DeserializeServerlessEndpointContentSafety(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContentSafetyStatus contentSafetyStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contentSafetyStatus"u8)) + { + contentSafetyStatus = new ContentSafetyStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointContentSafety(contentSafetyStatus, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointContentSafety IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointContentSafety(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs similarity index 60% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs index 7132feb9c94a1..e6dca65e1513b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutologgerSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Settings for Autologger. - internal partial class AutologgerSettings + /// The ServerlessEndpointContentSafety. + internal partial class ServerlessEndpointContentSafety { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,28 @@ internal partial class AutologgerSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// [Required] Indicates whether mlflow autologger is enabled. - public AutologgerSettings(MachineLearningFlowAutoLoggerState mlflowAutologger) + /// Initializes a new instance of . + /// Specifies the status of content safety. + public ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus) { - MlflowAutologger = mlflowAutologger; + ContentSafetyStatus = contentSafetyStatus; } - /// Initializes a new instance of . - /// [Required] Indicates whether mlflow autologger is enabled. + /// Initializes a new instance of . + /// Specifies the status of content safety. /// Keeps track of any properties unknown to the library. - internal AutologgerSettings(MachineLearningFlowAutoLoggerState mlflowAutologger, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus, IDictionary serializedAdditionalRawData) { - MlflowAutologger = mlflowAutologger; + ContentSafetyStatus = contentSafetyStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AutologgerSettings() + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointContentSafety() { } - /// [Required] Indicates whether mlflow autologger is enabled. - public MachineLearningFlowAutoLoggerState MlflowAutologger { get; set; } + /// Specifies the status of content safety. + public ContentSafetyStatus ContentSafetyStatus { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs index bcf0e14efae05..a6b10fe0200f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs @@ -13,33 +13,32 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownModelPerformanceMetricThresholdBase : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessEndpointInferenceEndpoint : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("modelType"u8); - writer.WriteStringValue(ModelType.ToString()); - if (Optional.IsDefined(Threshold)) + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) { - if (Threshold != null) + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) { - writer.WritePropertyName("threshold"u8); - writer.WriteObjectValue(Threshold, options); - } - else - { - writer.WriteNull("threshold"); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } + writer.WriteEndObject(); } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteEndObject(); } - ModelPerformanceMetricThresholdBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessEndpointInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); + return DeserializeServerlessEndpointInferenceEndpoint(document.RootElement, options); } - internal static UnknownModelPerformanceMetricThresholdBase DeserializeUnknownModelPerformanceMetricThresholdBase(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessEndpointInferenceEndpoint DeserializeServerlessEndpointInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,25 +77,29 @@ internal static UnknownModelPerformanceMetricThresholdBase DeserializeUnknownMod { return null; } - MonitoringModelType modelType = "Unknown"; - MonitoringThreshold threshold = default; + IReadOnlyDictionary headers = default; + Uri uri = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("modelType"u8)) - { - modelType = new MonitoringModelType(property.Value.GetString()); - continue; - } - if (property.NameEquals("threshold"u8)) + if (property.NameEquals("headers"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - threshold = null; continue; } - threshold = MonitoringThreshold.DeserializeMonitoringThreshold(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + headers = dictionary; + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,38 +108,38 @@ internal static UnknownModelPerformanceMetricThresholdBase DeserializeUnknownMod } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownModelPerformanceMetricThresholdBase(modelType, threshold, serializedAdditionalRawData); + return new ServerlessEndpointInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support writing '{options.Format}' format."); } } - ModelPerformanceMetricThresholdBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessEndpointInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelPerformanceMetricThresholdBase(document.RootElement, options); + return DeserializeServerlessEndpointInferenceEndpoint(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ModelPerformanceMetricThresholdBase)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs new file mode 100644 index 0000000000000..eb530c9162ab4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointInferenceEndpoint. + public partial class ServerlessEndpointInferenceEndpoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointInferenceEndpoint(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Headers = new ChangeTrackingDictionary(); + Uri = uri; + } + + /// Initializes a new instance of . + /// Dictionary of <string>. + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointInferenceEndpoint(IReadOnlyDictionary headers, Uri uri, IDictionary serializedAdditionalRawData) + { + Headers = headers; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointInferenceEndpoint() + { + } + + /// Dictionary of <string>. + public IReadOnlyDictionary Headers { get; } + /// Gets or sets the uri. + public Uri Uri { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs similarity index 54% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs index 34ecd1edae807..33387b645913e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs @@ -13,21 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class UnknownBaseEnvironmentSource : IUtf8JsonSerializable, IJsonModel + internal partial class ServerlessEndpointModelSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("baseEnvironmentSourceType"u8); - writer.WriteStringValue(BaseEnvironmentSourceType.ToString()); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - BaseEnvironmentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessEndpointModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseEnvironmentSource(document.RootElement, options); + return DeserializeServerlessEndpointModelSettings(document.RootElement, options); } - internal static UnknownBaseEnvironmentSource DeserializeUnknownBaseEnvironmentSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessEndpointModelSettings DeserializeServerlessEndpointModelSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +66,14 @@ internal static UnknownBaseEnvironmentSource DeserializeUnknownBaseEnvironmentSo { return null; } - BaseEnvironmentSourceType baseEnvironmentSourceType = "Unknown"; + string modelId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("baseEnvironmentSourceType"u8)) + if (property.NameEquals("modelId"u8)) { - baseEnvironmentSourceType = new BaseEnvironmentSourceType(property.Value.GetString()); + modelId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +82,38 @@ internal static UnknownBaseEnvironmentSource DeserializeUnknownBaseEnvironmentSo } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownBaseEnvironmentSource(baseEnvironmentSourceType, serializedAdditionalRawData); + return new ServerlessEndpointModelSettings(modelId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support writing '{options.Format}' format."); } } - BaseEnvironmentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessEndpointModelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseEnvironmentSource(document.RootElement, options); + return DeserializeServerlessEndpointModelSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BaseEnvironmentSource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs similarity index 61% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs index 1fc50b67c3972..8971c72c55109 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingDataConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Labeling data configuration definition. - public partial class LabelingDataConfiguration + /// The ServerlessEndpointModelSettings. + internal partial class ServerlessEndpointModelSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,31 @@ public partial class LabelingDataConfiguration /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public LabelingDataConfiguration() + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointModelSettings(string modelId) { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; } - /// Initializes a new instance of . - /// Resource Id of the data asset to perform labeling. - /// Indicates whether to enable incremental data refresh. + /// Initializes a new instance of . + /// /// Keeps track of any properties unknown to the library. - internal LabelingDataConfiguration(string dataId, IncrementalDataRefresh? incrementalDataRefresh, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointModelSettings(string modelId, IDictionary serializedAdditionalRawData) { - DataId = dataId; - IncrementalDataRefresh = incrementalDataRefresh; + ModelId = modelId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Resource Id of the data asset to perform labeling. - public string DataId { get; set; } - /// Indicates whether to enable incremental data refresh. - public IncrementalDataRefresh? IncrementalDataRefresh { get; set; } + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointModelSettings() + { + } + + /// Gets or sets the model id. + public string ModelId { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs similarity index 52% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs index 197f1fd5d2ac3..df1c9acd0a4c2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PackageInputPathVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs @@ -13,45 +13,40 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class PackageInputPathVersion : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessEndpointPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ResourceName)) + if (Optional.IsDefined(Identity)) { - if (ResourceName != null) - { - writer.WritePropertyName("resourceName"u8); - writer.WriteStringValue(ResourceName); - } - else - { - writer.WriteNull("resourceName"); - } + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); } - if (Optional.IsDefined(ResourceVersion)) + if (Optional.IsDefined(Sku)) { - if (ResourceVersion != null) - { - writer.WritePropertyName("resourceVersion"u8); - writer.WriteStringValue(ResourceVersion); - } - else + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteNull("resourceVersion"); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } + writer.WriteEndObject(); } - writer.WritePropertyName("inputPathType"u8); - writer.WriteStringValue(InputPathType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,19 +65,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - PackageInputPathVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessEndpointPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePackageInputPathVersion(document.RootElement, options); + return DeserializeServerlessEndpointPatch(document.RootElement, options); } - internal static PackageInputPathVersion DeserializePackageInputPathVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessEndpointPatch DeserializeServerlessEndpointPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -90,36 +85,43 @@ internal static PackageInputPathVersion DeserializePackageInputPathVersion(JsonE { return null; } - string resourceName = default; - string resourceVersion = default; - InputPathType inputPathType = default; + MachineLearningPartialManagedServiceIdentity identity = default; + MachineLearningSkuPatch sku = default; + IDictionary tags = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceName"u8)) + if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - resourceName = null; continue; } - resourceName = property.Value.GetString(); + identity = MachineLearningPartialManagedServiceIdentity.DeserializeMachineLearningPartialManagedServiceIdentity(property.Value, options); continue; } - if (property.NameEquals("resourceVersion"u8)) + if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - resourceVersion = null; continue; } - resourceVersion = property.Value.GetString(); + sku = MachineLearningSkuPatch.DeserializeMachineLearningSkuPatch(property.Value, options); continue; } - if (property.NameEquals("inputPathType"u8)) + if (property.NameEquals("tags"u8)) { - inputPathType = new InputPathType(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; continue; } if (options.Format != "W") @@ -128,38 +130,38 @@ internal static PackageInputPathVersion DeserializePackageInputPathVersion(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new PackageInputPathVersion(inputPathType, serializedAdditionalRawData, resourceName, resourceVersion); + return new ServerlessEndpointPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, identity, sku); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support writing '{options.Format}' format."); } } - PackageInputPathVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessEndpointPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePackageInputPathVersion(document.RootElement, options); + return DeserializeServerlessEndpointPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PackageInputPathVersion)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessEndpointPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs new file mode 100644 index 0000000000000..137336fae71e7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Strictly used in update requests. + public partial class ServerlessEndpointPatch : MachineLearningResourcePatch + { + /// Initializes a new instance of . + public ServerlessEndpointPatch() + { + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + internal ServerlessEndpointPatch(IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningPartialManagedServiceIdentity identity, MachineLearningSkuPatch sku) : base(tags, serializedAdditionalRawData) + { + Identity = identity; + Sku = sku; + } + + /// Managed service identity (system assigned and/or user assigned identities). + public MachineLearningPartialManagedServiceIdentity Identity { get; set; } + /// Sku details required for ARM contract for Autoscaling. + public MachineLearningSkuPatch Sku { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs new file mode 100644 index 0000000000000..dbf0dcccaa49c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.ToString()); + if (Optional.IsDefined(ContentSafety)) + { + if (ContentSafety != null) + { + writer.WritePropertyName("contentSafety"u8); + writer.WriteObjectValue(ContentSafety, options); + } + else + { + writer.WriteNull("contentSafety"); + } + } + if (options.Format != "W" && Optional.IsDefined(EndpointState)) + { + writer.WritePropertyName("endpointState"u8); + writer.WriteStringValue(EndpointState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(InferenceEndpoint)) + { + if (InferenceEndpoint != null) + { + writer.WritePropertyName("inferenceEndpoint"u8); + writer.WriteObjectValue(InferenceEndpoint, options); + } + else + { + writer.WriteNull("inferenceEndpoint"); + } + } + if (options.Format != "W" && Optional.IsDefined(MarketplaceSubscriptionId)) + { + if (MarketplaceSubscriptionId != null) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + else + { + writer.WriteNull("marketplaceSubscriptionId"); + } + } + if (Optional.IsDefined(ModelSettings)) + { + if (ModelSettings != null) + { + writer.WritePropertyName("modelSettings"u8); + writer.WriteObjectValue(ModelSettings, options); + } + else + { + writer.WriteNull("modelSettings"); + } + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointProperties(document.RootElement, options); + } + + internal static ServerlessEndpointProperties DeserializeServerlessEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServerlessInferenceEndpointAuthMode authMode = default; + ContentSafety contentSafety = default; + ServerlessEndpointState? endpointState = default; + ServerlessInferenceEndpoint inferenceEndpoint = default; + string marketplaceSubscriptionId = default; + ModelSettings modelSettings = default; + MachineLearningEndpointProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + authMode = new ServerlessInferenceEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("contentSafety"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + contentSafety = null; + continue; + } + contentSafety = ContentSafety.DeserializeContentSafety(property.Value, options); + continue; + } + if (property.NameEquals("endpointState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointState = new ServerlessEndpointState(property.Value.GetString()); + continue; + } + if (property.NameEquals("inferenceEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + inferenceEndpoint = null; + continue; + } + inferenceEndpoint = ServerlessInferenceEndpoint.DeserializeServerlessInferenceEndpoint(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + marketplaceSubscriptionId = null; + continue; + } + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + modelSettings = null; + continue; + } + modelSettings = ModelSettings.DeserializeModelSettings(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MachineLearningEndpointProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointProperties( + authMode, + contentSafety, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + modelSettings, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs new file mode 100644 index 0000000000000..e3db0035b547c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointProperties. + public partial class ServerlessEndpointProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] Specifies the authentication mode for the Serverless endpoint. + public ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode) + { + AuthMode = authMode; + } + + /// Initializes a new instance of . + /// [Required] Specifies the authentication mode for the Serverless endpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// The current state of the ServerlessEndpoint. + /// The inference uri to target when making requests against the serverless endpoint. + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// Provisioning state for the endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode, ContentSafety contentSafety, ServerlessEndpointState? endpointState, ServerlessInferenceEndpoint inferenceEndpoint, string marketplaceSubscriptionId, ModelSettings modelSettings, MachineLearningEndpointProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthMode = authMode; + ContentSafety = contentSafety; + EndpointState = endpointState; + InferenceEndpoint = inferenceEndpoint; + MarketplaceSubscriptionId = marketplaceSubscriptionId; + ModelSettings = modelSettings; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointProperties() + { + } + + /// [Required] Specifies the authentication mode for the Serverless endpoint. + public ServerlessInferenceEndpointAuthMode AuthMode { get; set; } + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + internal ContentSafety ContentSafety { get; set; } + /// [Required] Specifies the status of content safety. + public ContentSafetyStatus? ContentSafetyStatus + { + get => ContentSafety is null ? default(ContentSafetyStatus?) : ContentSafety.ContentSafetyStatus; + set + { + ContentSafety = value.HasValue ? new ContentSafety(value.Value) : null; + } + } + + /// The current state of the ServerlessEndpoint. + public ServerlessEndpointState? EndpointState { get; } + /// The inference uri to target when making requests against the serverless endpoint. + public ServerlessInferenceEndpoint InferenceEndpoint { get; } + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + public string MarketplaceSubscriptionId { get; } + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + internal ModelSettings ModelSettings { get; set; } + /// The unique model identifier that this ServerlessEndpoint should provision. + public string ModelId + { + get => ModelSettings is null ? default : ModelSettings.ModelId; + set + { + if (ModelSettings is null) + ModelSettings = new ModelSettings(); + ModelSettings.ModelId = value; + } + } + + /// Provisioning state for the endpoint. + public MachineLearningEndpointProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..52b5229b2826d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } + if (Optional.IsDefined(CapacityReservation)) + { + writer.WritePropertyName("capacityReservation"u8); + writer.WriteObjectValue(CapacityReservation, options); + } + if (Optional.IsDefined(ContentSafety)) + { + writer.WritePropertyName("contentSafety"u8); + writer.WriteObjectValue(ContentSafety, options); + } + if (Optional.IsDefined(EndpointState)) + { + writer.WritePropertyName("endpointState"u8); + writer.WriteStringValue(EndpointState.Value.ToString()); + } + if (Optional.IsDefined(InferenceEndpoint)) + { + writer.WritePropertyName("inferenceEndpoint"u8); + writer.WriteObjectValue(InferenceEndpoint, options); + } + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Metadata); +#else + using (JsonDocument document = JsonDocument.Parse(Metadata)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(ModelSettings)) + { + writer.WritePropertyName("modelSettings"u8); + writer.WriteObjectValue(ModelSettings, options); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteObjectValue(Offer, options); + } + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointResourceProperties(document.RootElement, options); + } + + internal static ServerlessEndpointResourceProperties DeserializeServerlessEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServerlessInferenceEndpointAuthMode? authMode = default; + ServerlessEndpointCapacityReservation capacityReservation = default; + ServerlessEndpointContentSafety contentSafety = default; + ServerlessEndpointState? endpointState = default; + ServerlessEndpointInferenceEndpoint inferenceEndpoint = default; + string marketplaceSubscriptionId = default; + BinaryData metadata = default; + ServerlessEndpointModelSettings modelSettings = default; + ServerlessOffer offer = default; + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServerlessInferenceEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("capacityReservation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityReservation = ServerlessEndpointCapacityReservation.DeserializeServerlessEndpointCapacityReservation(property.Value, options); + continue; + } + if (property.NameEquals("contentSafety"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentSafety = ServerlessEndpointContentSafety.DeserializeServerlessEndpointContentSafety(property.Value, options); + continue; + } + if (property.NameEquals("endpointState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointState = new ServerlessEndpointState(property.Value.GetString()); + continue; + } + if (property.NameEquals("inferenceEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inferenceEndpoint = ServerlessEndpointInferenceEndpoint.DeserializeServerlessEndpointInferenceEndpoint(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadata = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("modelSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modelSettings = ServerlessEndpointModelSettings.DeserializeServerlessEndpointModelSettings(property.Value, options); + continue; + } + if (property.NameEquals("offer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offer = ServerlessOffer.DeserializeServerlessOffer(property.Value, options); + continue; + } + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData, + authMode, + capacityReservation, + contentSafety, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + metadata, + modelSettings, + offer); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs new file mode 100644 index 0000000000000..3a4142dae258c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointResourceProperties. + public partial class ServerlessEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ServerlessEndpointResourceProperties() + { + EndpointType = EndpointType.ServerlessEndpoint; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + /// + /// + /// + /// State of the Serverless Endpoint. + /// + /// + /// Anything. + /// + /// + internal ServerlessEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData, ServerlessInferenceEndpointAuthMode? authMode, ServerlessEndpointCapacityReservation capacityReservation, ServerlessEndpointContentSafety contentSafety, ServerlessEndpointState? endpointState, ServerlessEndpointInferenceEndpoint inferenceEndpoint, string marketplaceSubscriptionId, BinaryData metadata, ServerlessEndpointModelSettings modelSettings, ServerlessOffer offer) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + AuthMode = authMode; + CapacityReservation = capacityReservation; + ContentSafety = contentSafety; + EndpointState = endpointState; + InferenceEndpoint = inferenceEndpoint; + MarketplaceSubscriptionId = marketplaceSubscriptionId; + Metadata = metadata; + ModelSettings = modelSettings; + Offer = offer; + EndpointType = endpointType; + } + + /// Gets or sets the auth mode. + public ServerlessInferenceEndpointAuthMode? AuthMode { get; set; } + /// Gets or sets the capacity reservation. + public ServerlessEndpointCapacityReservation CapacityReservation { get; set; } + /// Gets or sets the content safety. + internal ServerlessEndpointContentSafety ContentSafety { get; set; } + /// Specifies the status of content safety. + public ContentSafetyStatus? ContentSafetyStatus + { + get => ContentSafety is null ? default(ContentSafetyStatus?) : ContentSafety.ContentSafetyStatus; + set + { + ContentSafety = value.HasValue ? new ServerlessEndpointContentSafety(value.Value) : null; + } + } + + /// State of the Serverless Endpoint. + public ServerlessEndpointState? EndpointState { get; set; } + /// Gets or sets the inference endpoint. + public ServerlessEndpointInferenceEndpoint InferenceEndpoint { get; set; } + /// Gets or sets the marketplace subscription id. + public string MarketplaceSubscriptionId { get; set; } + /// + /// Anything + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Metadata { get; set; } + /// Gets or sets the model settings. + internal ServerlessEndpointModelSettings ModelSettings { get; set; } + /// Gets or sets the model id. + public string ModelId + { + get => ModelSettings is null ? default : ModelSettings.ModelId; + set => ModelSettings = new ServerlessEndpointModelSettings(value); + } + + /// Gets or sets the offer. + public ServerlessOffer Offer { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs new file mode 100644 index 0000000000000..20ed358358e1f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// State of the Serverless Endpoint. + public readonly partial struct ServerlessEndpointState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServerlessEndpointState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string SuspendingValue = "Suspending"; + private const string ReinstatingValue = "Reinstating"; + private const string OnlineValue = "Online"; + private const string SuspendedValue = "Suspended"; + private const string CreationFailedValue = "CreationFailed"; + private const string DeletionFailedValue = "DeletionFailed"; + + /// Unknown. + public static ServerlessEndpointState Unknown { get; } = new ServerlessEndpointState(UnknownValue); + /// Creating. + public static ServerlessEndpointState Creating { get; } = new ServerlessEndpointState(CreatingValue); + /// Deleting. + public static ServerlessEndpointState Deleting { get; } = new ServerlessEndpointState(DeletingValue); + /// Suspending. + public static ServerlessEndpointState Suspending { get; } = new ServerlessEndpointState(SuspendingValue); + /// Reinstating. + public static ServerlessEndpointState Reinstating { get; } = new ServerlessEndpointState(ReinstatingValue); + /// Online. + public static ServerlessEndpointState Online { get; } = new ServerlessEndpointState(OnlineValue); + /// Suspended. + public static ServerlessEndpointState Suspended { get; } = new ServerlessEndpointState(SuspendedValue); + /// CreationFailed. + public static ServerlessEndpointState CreationFailed { get; } = new ServerlessEndpointState(CreationFailedValue); + /// DeletionFailed. + public static ServerlessEndpointState DeletionFailed { get; } = new ServerlessEndpointState(DeletionFailedValue); + /// Determines if two values are the same. + public static bool operator ==(ServerlessEndpointState left, ServerlessEndpointState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServerlessEndpointState left, ServerlessEndpointState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServerlessEndpointState(string value) => new ServerlessEndpointState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServerlessEndpointState other && Equals(other); + /// + public bool Equals(ServerlessEndpointState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 0000000000000..dc873f503bf42 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ServerlessEndpointTrackedResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointTrackedResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); + } + + internal static ServerlessEndpointTrackedResourceArmPaginatedResult DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServerlessEndpointData.DeserializeServerlessEndpointData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointTrackedResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointTrackedResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs similarity index 62% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs index 916d2df9caa61..e51f01c2ded01 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/LabelingJobResourceArmPaginatedResult.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// A paginated list of LabelingJob entities. - internal partial class LabelingJobResourceArmPaginatedResult + /// A paginated list of ServerlessEndpoint entities. + internal partial class ServerlessEndpointTrackedResourceArmPaginatedResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,26 @@ internal partial class LabelingJobResourceArmPaginatedResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal LabelingJobResourceArmPaginatedResult() + /// Initializes a new instance of . + internal ServerlessEndpointTrackedResourceArmPaginatedResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The link to the next page of LabelingJob objects. If null, there are no additional pages. - /// An array of objects of type LabelingJob. + /// Initializes a new instance of . + /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. + /// An array of objects of type ServerlessEndpoint. /// Keeps track of any properties unknown to the library. - internal LabelingJobResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal ServerlessEndpointTrackedResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) { NextLink = nextLink; Value = value; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link to the next page of LabelingJob objects. If null, there are no additional pages. + /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. public string NextLink { get; } - /// An array of objects of type LabelingJob. - public IReadOnlyList Value { get; } + /// An array of objects of type ServerlessEndpoint. + public IReadOnlyList Value { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs similarity index 52% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs index e83af705645c7..18fda5b97b887 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PartialNotificationSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs @@ -13,37 +13,39 @@ namespace Azure.ResourceManager.MachineLearning.Models { - internal partial class PartialNotificationSetting : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessInferenceEndpoint : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Webhooks)) + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) { - if (Webhooks != null) + if (Headers != null) { - writer.WritePropertyName("webhooks"u8); + writer.WritePropertyName("headers"u8); writer.WriteStartObject(); - foreach (var item in Webhooks) + foreach (var item in Headers) { writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); + writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } else { - writer.WriteNull("webhooks"); + writer.WriteNull("headers"); } } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -62,19 +64,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - PartialNotificationSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePartialNotificationSetting(document.RootElement, options); + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); } - internal static PartialNotificationSetting DeserializePartialNotificationSetting(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -82,24 +84,30 @@ internal static PartialNotificationSetting DeserializePartialNotificationSetting { return null; } - IDictionary webhooks = default; + IReadOnlyDictionary headers = default; + Uri uri = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("webhooks"u8)) + if (property.NameEquals("headers"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - webhooks = null; + headers = null; continue; } - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, MachineLearningWebhook.DeserializeMachineLearningWebhook(property0.Value, options)); + dictionary.Add(property0.Name, property0.Value.GetString()); } - webhooks = dictionary; + headers = dictionary; + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -108,38 +116,38 @@ internal static PartialNotificationSetting DeserializePartialNotificationSetting } } serializedAdditionalRawData = rawDataDictionary; - return new PartialNotificationSetting(webhooks ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new ServerlessInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{options.Format}' format."); } } - PartialNotificationSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePartialNotificationSetting(document.RootElement, options); + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PartialNotificationSetting)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs new file mode 100644 index 0000000000000..759d80976d6d6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessInferenceEndpoint. + public partial class ServerlessInferenceEndpoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// is null. + internal ServerlessInferenceEndpoint(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Headers = new ChangeTrackingDictionary(); + Uri = uri; + } + + /// Initializes a new instance of . + /// Specifies any required headers to target this serverless endpoint. + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessInferenceEndpoint(IReadOnlyDictionary headers, Uri uri, IDictionary serializedAdditionalRawData) + { + Headers = headers; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessInferenceEndpoint() + { + } + + /// Specifies any required headers to target this serverless endpoint. + public IReadOnlyDictionary Headers { get; } + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + public Uri Uri { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs new file mode 100644 index 0000000000000..13b4dd94ff67b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpointAuthMode.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessInferenceEndpointAuthMode. + public readonly partial struct ServerlessInferenceEndpointAuthMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServerlessInferenceEndpointAuthMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeyValue = "Key"; + + /// Key. + public static ServerlessInferenceEndpointAuthMode Key { get; } = new ServerlessInferenceEndpointAuthMode(KeyValue); + /// Determines if two values are the same. + public static bool operator ==(ServerlessInferenceEndpointAuthMode left, ServerlessInferenceEndpointAuthMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServerlessInferenceEndpointAuthMode left, ServerlessInferenceEndpointAuthMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServerlessInferenceEndpointAuthMode(string value) => new ServerlessInferenceEndpointAuthMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServerlessInferenceEndpointAuthMode other && Equals(other); + /// + public bool Equals(ServerlessInferenceEndpointAuthMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs similarity index 55% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs index 05ae363c37dd7..3d5ffbd62a5df 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs @@ -13,24 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class IntellectualProperty : IUtf8JsonSerializable, IJsonModel + public partial class ServerlessOffer : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(ProtectionLevel)) - { - writer.WritePropertyName("protectionLevel"u8); - writer.WriteStringValue(ProtectionLevel.Value.ToString()); - } + writer.WritePropertyName("offerName"u8); + writer.WriteStringValue(OfferName); writer.WritePropertyName("publisher"u8); writer.WriteStringValue(Publisher); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -51,19 +48,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - IntellectualProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServerlessOffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIntellectualProperty(document.RootElement, options); + return DeserializeServerlessOffer(document.RootElement, options); } - internal static IntellectualProperty DeserializeIntellectualProperty(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServerlessOffer DeserializeServerlessOffer(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,19 +68,15 @@ internal static IntellectualProperty DeserializeIntellectualProperty(JsonElement { return null; } - IntellectualProtectionLevel? protectionLevel = default; + string offerName = default; string publisher = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("protectionLevel"u8)) + if (property.NameEquals("offerName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - protectionLevel = new IntellectualProtectionLevel(property.Value.GetString()); + offerName = property.Value.GetString(); continue; } if (property.NameEquals("publisher"u8)) @@ -97,38 +90,38 @@ internal static IntellectualProperty DeserializeIntellectualProperty(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new IntellectualProperty(protectionLevel, publisher, serializedAdditionalRawData); + return new ServerlessOffer(offerName, publisher, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support writing '{options.Format}' format."); } } - IntellectualProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServerlessOffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeIntellectualProperty(document.RootElement, options); + return DeserializeServerlessOffer(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IntellectualProperty)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs index 203461ef52013..faf4d027440c9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/IntellectualProperty.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Intellectual Property details for a resource. - public partial class IntellectualProperty + /// The ServerlessOffer. + public partial class ServerlessOffer { /// /// Keeps track of any properties unknown to the library. @@ -45,35 +45,38 @@ public partial class IntellectualProperty /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. - /// is null. - public IntellectualProperty(string publisher) + /// Initializes a new instance of . + /// + /// + /// or is null. + public ServerlessOffer(string offerName, string publisher) { + Argument.AssertNotNull(offerName, nameof(offerName)); Argument.AssertNotNull(publisher, nameof(publisher)); + OfferName = offerName; Publisher = publisher; } - /// Initializes a new instance of . - /// Protection level of the Intellectual Property. - /// [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. + /// Initializes a new instance of . + /// + /// /// Keeps track of any properties unknown to the library. - internal IntellectualProperty(IntellectualProtectionLevel? protectionLevel, string publisher, IDictionary serializedAdditionalRawData) + internal ServerlessOffer(string offerName, string publisher, IDictionary serializedAdditionalRawData) { - ProtectionLevel = protectionLevel; + OfferName = offerName; Publisher = publisher; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal IntellectualProperty() + /// Initializes a new instance of for deserialization. + internal ServerlessOffer() { } - /// Protection level of the Intellectual Property. - public IntellectualProtectionLevel? ProtectionLevel { get; set; } - /// [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. + /// Gets or sets the offer name. + public string OfferName { get; set; } + /// Gets or sets the publisher. public string Publisher { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs new file mode 100644 index 0000000000000..651f2dd032cf7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServiceAccountKeyName. + public readonly partial struct ServiceAccountKeyName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceAccountKeyName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Key1Value = "Key1"; + private const string Key2Value = "Key2"; + + /// Key1. + public static ServiceAccountKeyName Key1 { get; } = new ServiceAccountKeyName(Key1Value); + /// Key2. + public static ServiceAccountKeyName Key2 { get; } = new ServiceAccountKeyName(Key2Value); + /// Determines if two values are the same. + public static bool operator ==(ServiceAccountKeyName left, ServiceAccountKeyName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceAccountKeyName left, ServiceAccountKeyName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServiceAccountKeyName(string value) => new ServiceAccountKeyName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceAccountKeyName other && Equals(other); + /// + public bool Equals(ServiceAccountKeyName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs index d68a9abe87d5e..6be65baab1336 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -38,28 +38,72 @@ void IJsonModel.Write(Utf writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +145,17 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ WorkspaceConnectionServicePrincipal credentials = default; MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,6 +183,20 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,13 +206,68 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -154,6 +275,15 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -163,9 +293,17 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ return new ServicePrincipalAuthTypeWorkspaceConnectionProperties( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs index b61e38060f39d..d23a13d1d53ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -22,12 +23,20 @@ public ServicePrincipalAuthTypeWorkspaceConnectionProperties() /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. /// - internal ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData, WorkspaceConnectionServicePrincipal credentials) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionServicePrincipal credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs index e3e25ed2f533b..899a9cd602418 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs @@ -36,6 +36,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -83,6 +93,7 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle } ServiceTagDestination destination = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -107,6 +118,20 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,7 +152,13 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceTagOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new ServiceTagOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs index 3044028f3dbff..91e02ffc49d27 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs @@ -21,11 +21,12 @@ public ServiceTagOutboundRule() /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - internal ServiceTagOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, ServiceTagDestination destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal ServiceTagOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, ServiceTagDestination destination) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; OutboundRuleType = outboundRuleType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs index b0044007767ae..08ed4c9ccfa9f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs @@ -89,6 +89,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("environmentId"); } } + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + if (EnvironmentVariables != null) + { + writer.WritePropertyName("environmentVariables"u8); + writer.WriteStartObject(); + foreach (var item in EnvironmentVariables) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("environmentVariables"); + } + } if (Optional.IsCollectionDefined(Files)) { if (Files != null) @@ -272,24 +290,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -401,10 +401,11 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri } IList archives = default; string args = default; - string codeId = default; + ResourceIdentifier codeId = default; IDictionary conf = default; SparkJobEntry entry = default; - string environmentId = default; + ResourceIdentifier environmentId = default; + IDictionary environmentVariables = default; IList files = default; IDictionary inputs = default; IList jars = default; @@ -420,7 +421,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri bool? isArchived = default; JobType jobType = default; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -457,7 +457,7 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri } if (property.NameEquals("codeId"u8)) { - codeId = property.Value.GetString(); + codeId = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("conf"u8)) @@ -487,7 +487,22 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri environmentId = null; continue; } - environmentId = property.Value.GetString(); + environmentId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("environmentVariables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + environmentVariables = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + environmentVariables = dictionary; continue; } if (property.NameEquals("files"u8)) @@ -654,21 +669,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -752,7 +752,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status, archives ?? new ChangeTrackingList(), @@ -761,6 +760,7 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri conf ?? new ChangeTrackingDictionary(), entry, environmentId, + environmentVariables ?? new ChangeTrackingDictionary(), files ?? new ChangeTrackingList(), inputs ?? new ChangeTrackingDictionary(), jars ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs index db3414d23c5eb..6ac19e0aeb67c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs @@ -15,14 +15,14 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class SparkJob : MachineLearningJobProperties { /// Initializes a new instance of . - /// [Required] ARM resource ID of the code asset. + /// [Required] arm-id of the code asset. /// /// [Required] The entry to execute on startup of the job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// /// or is null. - public SparkJob(string codeId, SparkJobEntry entry) + public SparkJob(ResourceIdentifier codeId, SparkJobEntry entry) { Argument.AssertNotNull(codeId, nameof(codeId)); Argument.AssertNotNull(entry, nameof(entry)); @@ -31,6 +31,7 @@ public SparkJob(string codeId, SparkJobEntry entry) CodeId = codeId; Conf = new ChangeTrackingDictionary(); Entry = entry; + EnvironmentVariables = new ChangeTrackingDictionary(); Files = new ChangeTrackingList(); Inputs = new ChangeTrackingDictionary(); Jars = new ChangeTrackingList(); @@ -57,7 +58,6 @@ public SparkJob(string codeId, SparkJobEntry entry) /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. @@ -65,7 +65,7 @@ public SparkJob(string codeId, SparkJobEntry entry) /// Status of the job. /// Archive files used in the job. /// Arguments for the job. - /// [Required] ARM resource ID of the code asset. + /// [Required] arm-id of the code asset. /// Spark configured properties. /// /// [Required] The entry to execute on startup of the job. @@ -73,6 +73,7 @@ public SparkJob(string codeId, SparkJobEntry entry) /// The available derived classes include and . /// /// The ARM resource ID of the Environment specification for the job. + /// Environment variables included in the job. /// Files used in the job. /// /// Mapping of input data bindings used in the job. @@ -88,7 +89,7 @@ public SparkJob(string codeId, SparkJobEntry entry) /// Python files used in the job. /// Queue settings for the job. /// Compute Resource configuration for the job. - internal SparkJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status, IList archives, string args, string codeId, IDictionary conf, SparkJobEntry entry, string environmentId, IList files, IDictionary inputs, IList jars, IDictionary outputs, IList pyFiles, JobQueueSettings queueSettings, SparkResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal SparkJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, IList archives, string args, ResourceIdentifier codeId, IDictionary conf, SparkJobEntry entry, ResourceIdentifier environmentId, IDictionary environmentVariables, IList files, IDictionary inputs, IList jars, IDictionary outputs, IList pyFiles, JobQueueSettings queueSettings, SparkResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { Archives = archives; Args = args; @@ -96,6 +97,7 @@ internal SparkJob(string description, IDictionary properties, ID Conf = conf; Entry = entry; EnvironmentId = environmentId; + EnvironmentVariables = environmentVariables; Files = files; Inputs = inputs; Jars = jars; @@ -115,8 +117,8 @@ internal SparkJob() public IList Archives { get; set; } /// Arguments for the job. public string Args { get; set; } - /// [Required] ARM resource ID of the code asset. - public string CodeId { get; set; } + /// [Required] arm-id of the code asset. + public ResourceIdentifier CodeId { get; set; } /// Spark configured properties. public IDictionary Conf { get; set; } /// @@ -126,7 +128,9 @@ internal SparkJob() /// public SparkJobEntry Entry { get; set; } /// The ARM resource ID of the Environment specification for the job. - public string EnvironmentId { get; set; } + public ResourceIdentifier EnvironmentId { get; set; } + /// Environment variables included in the job. + public IDictionary EnvironmentVariables { get; set; } /// Files used in the job. public IList Files { get; set; } /// @@ -146,7 +150,19 @@ internal SparkJob() /// Python files used in the job. public IList PyFiles { get; set; } /// Queue settings for the job. - public JobQueueSettings QueueSettings { get; set; } + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + /// Compute Resource configuration for the job. public SparkResourceConfiguration Resources { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..2ef1472d3ea19 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SpeechEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpeechEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static SpeechEndpointDeploymentResourceProperties DeserializeSpeechEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SpeechEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..a683fbee428d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The SpeechEndpointDeploymentResourceProperties. + public partial class SpeechEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public SpeechEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.Speech"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal SpeechEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.Speech"; + } + + /// Initializes a new instance of for deserialization. + internal SpeechEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..82b4200464e19 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SpeechEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpeechEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechEndpointResourceProperties(document.RootElement, options); + } + + internal static SpeechEndpointResourceProperties DeserializeSpeechEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SpeechEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs new file mode 100644 index 0000000000000..7270ce4db5afa --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The SpeechEndpointResourceProperties. + public partial class SpeechEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public SpeechEndpointResourceProperties() + { + EndpointType = EndpointType.AzureSpeech; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal SpeechEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs index 3a28979c22bb3..66bb5c6cce714 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs @@ -35,7 +35,7 @@ public StaticInputData(JobInputType jobInputType, Uri uri, DateTimeOffset window /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// Keeps track of any properties unknown to the library. - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. /// [Required] The end date of the data window. /// [Required] The start date of the data window. internal StaticInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, DateTimeOffset windowEnd, DateTimeOffset windowStart) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) @@ -51,7 +51,7 @@ internal StaticInputData() { } - /// The ARM resource ID of the component resource used to preprocess the data. + /// Reference to the component asset used to preprocess the data. public string PreprocessingComponentId { get; set; } /// [Required] The end date of the data window. public DateTimeOffset WindowEnd { get; set; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs index e2c5fe1ec91a2..f43e117cd8ad7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StorageAccountDetails.cs @@ -53,7 +53,7 @@ public StorageAccountDetails() /// Initializes a new instance of . /// Details of system created storage account to be used for the registry. - /// Details of user created storage account to be used for the registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created storage account to be used for the registry. /// Keeps track of any properties unknown to the library. internal StorageAccountDetails(SystemCreatedStorageAccount systemCreatedStorageAccount, UserCreatedStorageAccount userCreatedStorageAccount, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal StorageAccountDetails(SystemCreatedStorageAccount systemCreatedStorageA /// Details of system created storage account to be used for the registry. public SystemCreatedStorageAccount SystemCreatedStorageAccount { get; set; } - /// Details of user created storage account to be used for the registry. Not supported in most cases and will throw 400 error if provided. + /// Details of user created storage account to be used for the registry. internal UserCreatedStorageAccount UserCreatedStorageAccount { get; set; } /// /// Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs deleted file mode 100644 index 7506941223ec7..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.Serialization.cs +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TableFixedParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Booster)) - { - if (Booster != null) - { - writer.WritePropertyName("booster"u8); - writer.WriteStringValue(Booster); - } - else - { - writer.WriteNull("booster"); - } - } - if (Optional.IsDefined(BoostingType)) - { - if (BoostingType != null) - { - writer.WritePropertyName("boostingType"u8); - writer.WriteStringValue(BoostingType); - } - else - { - writer.WriteNull("boostingType"); - } - } - if (Optional.IsDefined(GrowPolicy)) - { - if (GrowPolicy != null) - { - writer.WritePropertyName("growPolicy"u8); - writer.WriteStringValue(GrowPolicy); - } - else - { - writer.WriteNull("growPolicy"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteNumberValue(LearningRate.Value); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(MaxBin)) - { - if (MaxBin != null) - { - writer.WritePropertyName("maxBin"u8); - writer.WriteNumberValue(MaxBin.Value); - } - else - { - writer.WriteNull("maxBin"); - } - } - if (Optional.IsDefined(MaxDepth)) - { - if (MaxDepth != null) - { - writer.WritePropertyName("maxDepth"u8); - writer.WriteNumberValue(MaxDepth.Value); - } - else - { - writer.WriteNull("maxDepth"); - } - } - if (Optional.IsDefined(MaxLeaves)) - { - if (MaxLeaves != null) - { - writer.WritePropertyName("maxLeaves"u8); - writer.WriteNumberValue(MaxLeaves.Value); - } - else - { - writer.WriteNull("maxLeaves"); - } - } - if (Optional.IsDefined(MinDataInLeaf)) - { - if (MinDataInLeaf != null) - { - writer.WritePropertyName("minDataInLeaf"u8); - writer.WriteNumberValue(MinDataInLeaf.Value); - } - else - { - writer.WriteNull("minDataInLeaf"); - } - } - if (Optional.IsDefined(MinSplitGain)) - { - if (MinSplitGain != null) - { - writer.WritePropertyName("minSplitGain"u8); - writer.WriteNumberValue(MinSplitGain.Value); - } - else - { - writer.WriteNull("minSplitGain"); - } - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NEstimators)) - { - if (NEstimators != null) - { - writer.WritePropertyName("nEstimators"u8); - writer.WriteNumberValue(NEstimators.Value); - } - else - { - writer.WriteNull("nEstimators"); - } - } - if (Optional.IsDefined(NumLeaves)) - { - if (NumLeaves != null) - { - writer.WritePropertyName("numLeaves"u8); - writer.WriteNumberValue(NumLeaves.Value); - } - else - { - writer.WriteNull("numLeaves"); - } - } - if (Optional.IsDefined(PreprocessorName)) - { - if (PreprocessorName != null) - { - writer.WritePropertyName("preprocessorName"u8); - writer.WriteStringValue(PreprocessorName); - } - else - { - writer.WriteNull("preprocessorName"); - } - } - if (Optional.IsDefined(RegAlpha)) - { - if (RegAlpha != null) - { - writer.WritePropertyName("regAlpha"u8); - writer.WriteNumberValue(RegAlpha.Value); - } - else - { - writer.WriteNull("regAlpha"); - } - } - if (Optional.IsDefined(RegLambda)) - { - if (RegLambda != null) - { - writer.WritePropertyName("regLambda"u8); - writer.WriteNumberValue(RegLambda.Value); - } - else - { - writer.WriteNull("regLambda"); - } - } - if (Optional.IsDefined(Subsample)) - { - if (Subsample != null) - { - writer.WritePropertyName("subsample"u8); - writer.WriteNumberValue(Subsample.Value); - } - else - { - writer.WriteNull("subsample"); - } - } - if (Optional.IsDefined(SubsampleFreq)) - { - if (SubsampleFreq != null) - { - writer.WritePropertyName("subsampleFreq"u8); - writer.WriteNumberValue(SubsampleFreq.Value); - } - else - { - writer.WriteNull("subsampleFreq"); - } - } - if (Optional.IsDefined(TreeMethod)) - { - if (TreeMethod != null) - { - writer.WritePropertyName("treeMethod"u8); - writer.WriteStringValue(TreeMethod); - } - else - { - writer.WriteNull("treeMethod"); - } - } - if (Optional.IsDefined(WithMean)) - { - writer.WritePropertyName("withMean"u8); - writer.WriteBooleanValue(WithMean.Value); - } - if (Optional.IsDefined(WithStd)) - { - writer.WritePropertyName("withStd"u8); - writer.WriteBooleanValue(WithStd.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TableFixedParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableFixedParameters(document.RootElement, options); - } - - internal static TableFixedParameters DeserializeTableFixedParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string booster = default; - string boostingType = default; - string growPolicy = default; - double? learningRate = default; - int? maxBin = default; - int? maxDepth = default; - int? maxLeaves = default; - int? minDataInLeaf = default; - double? minSplitGain = default; - string modelName = default; - int? nEstimators = default; - int? numLeaves = default; - string preprocessorName = default; - double? regAlpha = default; - double? regLambda = default; - double? subsample = default; - double? subsampleFreq = default; - string treeMethod = default; - bool? withMean = default; - bool? withStd = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("booster"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - booster = null; - continue; - } - booster = property.Value.GetString(); - continue; - } - if (property.NameEquals("boostingType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - boostingType = null; - continue; - } - boostingType = property.Value.GetString(); - continue; - } - if (property.NameEquals("growPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - growPolicy = null; - continue; - } - growPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("maxBin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxBin = null; - continue; - } - maxBin = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxDepth"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxDepth = null; - continue; - } - maxDepth = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxLeaves = null; - continue; - } - maxLeaves = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minDataInLeaf"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minDataInLeaf = null; - continue; - } - minDataInLeaf = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minSplitGain"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minSplitGain = null; - continue; - } - minSplitGain = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("nEstimators"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - nEstimators = null; - continue; - } - nEstimators = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("numLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numLeaves = null; - continue; - } - numLeaves = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("preprocessorName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - preprocessorName = null; - continue; - } - preprocessorName = property.Value.GetString(); - continue; - } - if (property.NameEquals("regAlpha"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regAlpha = null; - continue; - } - regAlpha = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("regLambda"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regLambda = null; - continue; - } - regLambda = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("subsample"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsample = null; - continue; - } - subsample = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("subsampleFreq"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsampleFreq = null; - continue; - } - subsampleFreq = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("treeMethod"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - treeMethod = null; - continue; - } - treeMethod = property.Value.GetString(); - continue; - } - if (property.NameEquals("withMean"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - withMean = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("withStd"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - withStd = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableFixedParameters( - booster, - boostingType, - growPolicy, - learningRate, - maxBin, - maxDepth, - maxLeaves, - minDataInLeaf, - minSplitGain, - modelName, - nEstimators, - numLeaves, - preprocessorName, - regAlpha, - regLambda, - subsample, - subsampleFreq, - treeMethod, - withMean, - withStd, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support writing '{options.Format}' format."); - } - } - - TableFixedParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTableFixedParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableFixedParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs deleted file mode 100644 index fddd314303ecf..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableFixedParameters.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Fixed training parameters that won't be swept over during AutoML Table training. - public partial class TableFixedParameters - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public TableFixedParameters() - { - } - - /// Initializes a new instance of . - /// Specify the boosting type, e.g gbdt for XGBoost. - /// Specify the boosting type, e.g gbdt for LightGBM. - /// Specify the grow policy, which controls the way new nodes are added to the tree. - /// The learning rate for the training procedure. - /// Specify the Maximum number of discrete bins to bucket continuous features . - /// Specify the max depth to limit the tree depth explicitly. - /// Specify the max leaves to limit the tree leaves explicitly. - /// The minimum number of data per leaf. - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - /// The name of the model to train. - /// Specify the number of trees (or rounds) in an model. - /// Specify the number of leaves. - /// The name of the preprocessor to use. - /// L1 regularization term on weights. - /// L2 regularization term on weights. - /// Subsample ratio of the training instance. - /// Frequency of subsample. - /// Specify the tree method. - /// If true, center before scaling the data with StandardScalar. - /// If true, scaling the data with Unit Variance with StandardScalar. - /// Keeps track of any properties unknown to the library. - internal TableFixedParameters(string booster, string boostingType, string growPolicy, double? learningRate, int? maxBin, int? maxDepth, int? maxLeaves, int? minDataInLeaf, double? minSplitGain, string modelName, int? nEstimators, int? numLeaves, string preprocessorName, double? regAlpha, double? regLambda, double? subsample, double? subsampleFreq, string treeMethod, bool? withMean, bool? withStd, IDictionary serializedAdditionalRawData) - { - Booster = booster; - BoostingType = boostingType; - GrowPolicy = growPolicy; - LearningRate = learningRate; - MaxBin = maxBin; - MaxDepth = maxDepth; - MaxLeaves = maxLeaves; - MinDataInLeaf = minDataInLeaf; - MinSplitGain = minSplitGain; - ModelName = modelName; - NEstimators = nEstimators; - NumLeaves = numLeaves; - PreprocessorName = preprocessorName; - RegAlpha = regAlpha; - RegLambda = regLambda; - Subsample = subsample; - SubsampleFreq = subsampleFreq; - TreeMethod = treeMethod; - WithMean = withMean; - WithStd = withStd; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specify the boosting type, e.g gbdt for XGBoost. - public string Booster { get; set; } - /// Specify the boosting type, e.g gbdt for LightGBM. - public string BoostingType { get; set; } - /// Specify the grow policy, which controls the way new nodes are added to the tree. - public string GrowPolicy { get; set; } - /// The learning rate for the training procedure. - public double? LearningRate { get; set; } - /// Specify the Maximum number of discrete bins to bucket continuous features . - public int? MaxBin { get; set; } - /// Specify the max depth to limit the tree depth explicitly. - public int? MaxDepth { get; set; } - /// Specify the max leaves to limit the tree leaves explicitly. - public int? MaxLeaves { get; set; } - /// The minimum number of data per leaf. - public int? MinDataInLeaf { get; set; } - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - public double? MinSplitGain { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Specify the number of trees (or rounds) in an model. - public int? NEstimators { get; set; } - /// Specify the number of leaves. - public int? NumLeaves { get; set; } - /// The name of the preprocessor to use. - public string PreprocessorName { get; set; } - /// L1 regularization term on weights. - public double? RegAlpha { get; set; } - /// L2 regularization term on weights. - public double? RegLambda { get; set; } - /// Subsample ratio of the training instance. - public double? Subsample { get; set; } - /// Frequency of subsample. - public double? SubsampleFreq { get; set; } - /// Specify the tree method. - public string TreeMethod { get; set; } - /// If true, center before scaling the data with StandardScalar. - public bool? WithMean { get; set; } - /// If true, scaling the data with Unit Variance with StandardScalar. - public bool? WithStd { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs deleted file mode 100644 index d8623eb3c794f..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.Serialization.cs +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TableParameterSubspace : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Booster)) - { - if (Booster != null) - { - writer.WritePropertyName("booster"u8); - writer.WriteStringValue(Booster); - } - else - { - writer.WriteNull("booster"); - } - } - if (Optional.IsDefined(BoostingType)) - { - if (BoostingType != null) - { - writer.WritePropertyName("boostingType"u8); - writer.WriteStringValue(BoostingType); - } - else - { - writer.WriteNull("boostingType"); - } - } - if (Optional.IsDefined(GrowPolicy)) - { - if (GrowPolicy != null) - { - writer.WritePropertyName("growPolicy"u8); - writer.WriteStringValue(GrowPolicy); - } - else - { - writer.WriteNull("growPolicy"); - } - } - if (Optional.IsDefined(LearningRate)) - { - if (LearningRate != null) - { - writer.WritePropertyName("learningRate"u8); - writer.WriteStringValue(LearningRate); - } - else - { - writer.WriteNull("learningRate"); - } - } - if (Optional.IsDefined(MaxBin)) - { - if (MaxBin != null) - { - writer.WritePropertyName("maxBin"u8); - writer.WriteStringValue(MaxBin); - } - else - { - writer.WriteNull("maxBin"); - } - } - if (Optional.IsDefined(MaxDepth)) - { - if (MaxDepth != null) - { - writer.WritePropertyName("maxDepth"u8); - writer.WriteStringValue(MaxDepth); - } - else - { - writer.WriteNull("maxDepth"); - } - } - if (Optional.IsDefined(MaxLeaves)) - { - if (MaxLeaves != null) - { - writer.WritePropertyName("maxLeaves"u8); - writer.WriteStringValue(MaxLeaves); - } - else - { - writer.WriteNull("maxLeaves"); - } - } - if (Optional.IsDefined(MinDataInLeaf)) - { - if (MinDataInLeaf != null) - { - writer.WritePropertyName("minDataInLeaf"u8); - writer.WriteStringValue(MinDataInLeaf); - } - else - { - writer.WriteNull("minDataInLeaf"); - } - } - if (Optional.IsDefined(MinSplitGain)) - { - if (MinSplitGain != null) - { - writer.WritePropertyName("minSplitGain"u8); - writer.WriteStringValue(MinSplitGain); - } - else - { - writer.WriteNull("minSplitGain"); - } - } - if (Optional.IsDefined(ModelName)) - { - if (ModelName != null) - { - writer.WritePropertyName("modelName"u8); - writer.WriteStringValue(ModelName); - } - else - { - writer.WriteNull("modelName"); - } - } - if (Optional.IsDefined(NEstimators)) - { - if (NEstimators != null) - { - writer.WritePropertyName("nEstimators"u8); - writer.WriteStringValue(NEstimators); - } - else - { - writer.WriteNull("nEstimators"); - } - } - if (Optional.IsDefined(NumLeaves)) - { - if (NumLeaves != null) - { - writer.WritePropertyName("numLeaves"u8); - writer.WriteStringValue(NumLeaves); - } - else - { - writer.WriteNull("numLeaves"); - } - } - if (Optional.IsDefined(PreprocessorName)) - { - if (PreprocessorName != null) - { - writer.WritePropertyName("preprocessorName"u8); - writer.WriteStringValue(PreprocessorName); - } - else - { - writer.WriteNull("preprocessorName"); - } - } - if (Optional.IsDefined(RegAlpha)) - { - if (RegAlpha != null) - { - writer.WritePropertyName("regAlpha"u8); - writer.WriteStringValue(RegAlpha); - } - else - { - writer.WriteNull("regAlpha"); - } - } - if (Optional.IsDefined(RegLambda)) - { - if (RegLambda != null) - { - writer.WritePropertyName("regLambda"u8); - writer.WriteStringValue(RegLambda); - } - else - { - writer.WriteNull("regLambda"); - } - } - if (Optional.IsDefined(Subsample)) - { - if (Subsample != null) - { - writer.WritePropertyName("subsample"u8); - writer.WriteStringValue(Subsample); - } - else - { - writer.WriteNull("subsample"); - } - } - if (Optional.IsDefined(SubsampleFreq)) - { - if (SubsampleFreq != null) - { - writer.WritePropertyName("subsampleFreq"u8); - writer.WriteStringValue(SubsampleFreq); - } - else - { - writer.WriteNull("subsampleFreq"); - } - } - if (Optional.IsDefined(TreeMethod)) - { - if (TreeMethod != null) - { - writer.WritePropertyName("treeMethod"u8); - writer.WriteStringValue(TreeMethod); - } - else - { - writer.WriteNull("treeMethod"); - } - } - if (Optional.IsDefined(WithMean)) - { - if (WithMean != null) - { - writer.WritePropertyName("withMean"u8); - writer.WriteStringValue(WithMean); - } - else - { - writer.WriteNull("withMean"); - } - } - if (Optional.IsDefined(WithStd)) - { - if (WithStd != null) - { - writer.WritePropertyName("withStd"u8); - writer.WriteStringValue(WithStd); - } - else - { - writer.WriteNull("withStd"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TableParameterSubspace IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableParameterSubspace(document.RootElement, options); - } - - internal static TableParameterSubspace DeserializeTableParameterSubspace(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string booster = default; - string boostingType = default; - string growPolicy = default; - string learningRate = default; - string maxBin = default; - string maxDepth = default; - string maxLeaves = default; - string minDataInLeaf = default; - string minSplitGain = default; - string modelName = default; - string nEstimators = default; - string numLeaves = default; - string preprocessorName = default; - string regAlpha = default; - string regLambda = default; - string subsample = default; - string subsampleFreq = default; - string treeMethod = default; - string withMean = default; - string withStd = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("booster"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - booster = null; - continue; - } - booster = property.Value.GetString(); - continue; - } - if (property.NameEquals("boostingType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - boostingType = null; - continue; - } - boostingType = property.Value.GetString(); - continue; - } - if (property.NameEquals("growPolicy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - growPolicy = null; - continue; - } - growPolicy = property.Value.GetString(); - continue; - } - if (property.NameEquals("learningRate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - learningRate = null; - continue; - } - learningRate = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxBin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxBin = null; - continue; - } - maxBin = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxDepth"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxDepth = null; - continue; - } - maxDepth = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - maxLeaves = null; - continue; - } - maxLeaves = property.Value.GetString(); - continue; - } - if (property.NameEquals("minDataInLeaf"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minDataInLeaf = null; - continue; - } - minDataInLeaf = property.Value.GetString(); - continue; - } - if (property.NameEquals("minSplitGain"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - minSplitGain = null; - continue; - } - minSplitGain = property.Value.GetString(); - continue; - } - if (property.NameEquals("modelName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - modelName = null; - continue; - } - modelName = property.Value.GetString(); - continue; - } - if (property.NameEquals("nEstimators"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - nEstimators = null; - continue; - } - nEstimators = property.Value.GetString(); - continue; - } - if (property.NameEquals("numLeaves"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - numLeaves = null; - continue; - } - numLeaves = property.Value.GetString(); - continue; - } - if (property.NameEquals("preprocessorName"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - preprocessorName = null; - continue; - } - preprocessorName = property.Value.GetString(); - continue; - } - if (property.NameEquals("regAlpha"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regAlpha = null; - continue; - } - regAlpha = property.Value.GetString(); - continue; - } - if (property.NameEquals("regLambda"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - regLambda = null; - continue; - } - regLambda = property.Value.GetString(); - continue; - } - if (property.NameEquals("subsample"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsample = null; - continue; - } - subsample = property.Value.GetString(); - continue; - } - if (property.NameEquals("subsampleFreq"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - subsampleFreq = null; - continue; - } - subsampleFreq = property.Value.GetString(); - continue; - } - if (property.NameEquals("treeMethod"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - treeMethod = null; - continue; - } - treeMethod = property.Value.GetString(); - continue; - } - if (property.NameEquals("withMean"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - withMean = null; - continue; - } - withMean = property.Value.GetString(); - continue; - } - if (property.NameEquals("withStd"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - withStd = null; - continue; - } - withStd = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableParameterSubspace( - booster, - boostingType, - growPolicy, - learningRate, - maxBin, - maxDepth, - maxLeaves, - minDataInLeaf, - minSplitGain, - modelName, - nEstimators, - numLeaves, - preprocessorName, - regAlpha, - regLambda, - subsample, - subsampleFreq, - treeMethod, - withMean, - withStd, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support writing '{options.Format}' format."); - } - } - - TableParameterSubspace IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTableParameterSubspace(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableParameterSubspace)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs deleted file mode 100644 index f866d59f05902..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableParameterSubspace.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The TableParameterSubspace. - public partial class TableParameterSubspace - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public TableParameterSubspace() - { - } - - /// Initializes a new instance of . - /// Specify the boosting type, e.g gbdt for XGBoost. - /// Specify the boosting type, e.g gbdt for LightGBM. - /// Specify the grow policy, which controls the way new nodes are added to the tree. - /// The learning rate for the training procedure. - /// Specify the Maximum number of discrete bins to bucket continuous features . - /// Specify the max depth to limit the tree depth explicitly. - /// Specify the max leaves to limit the tree leaves explicitly. - /// The minimum number of data per leaf. - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - /// The name of the model to train. - /// Specify the number of trees (or rounds) in an model. - /// Specify the number of leaves. - /// The name of the preprocessor to use. - /// L1 regularization term on weights. - /// L2 regularization term on weights. - /// Subsample ratio of the training instance. - /// Frequency of subsample. - /// Specify the tree method. - /// If true, center before scaling the data with StandardScalar. - /// If true, scaling the data with Unit Variance with StandardScalar. - /// Keeps track of any properties unknown to the library. - internal TableParameterSubspace(string booster, string boostingType, string growPolicy, string learningRate, string maxBin, string maxDepth, string maxLeaves, string minDataInLeaf, string minSplitGain, string modelName, string nEstimators, string numLeaves, string preprocessorName, string regAlpha, string regLambda, string subsample, string subsampleFreq, string treeMethod, string withMean, string withStd, IDictionary serializedAdditionalRawData) - { - Booster = booster; - BoostingType = boostingType; - GrowPolicy = growPolicy; - LearningRate = learningRate; - MaxBin = maxBin; - MaxDepth = maxDepth; - MaxLeaves = maxLeaves; - MinDataInLeaf = minDataInLeaf; - MinSplitGain = minSplitGain; - ModelName = modelName; - NEstimators = nEstimators; - NumLeaves = numLeaves; - PreprocessorName = preprocessorName; - RegAlpha = regAlpha; - RegLambda = regLambda; - Subsample = subsample; - SubsampleFreq = subsampleFreq; - TreeMethod = treeMethod; - WithMean = withMean; - WithStd = withStd; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specify the boosting type, e.g gbdt for XGBoost. - public string Booster { get; set; } - /// Specify the boosting type, e.g gbdt for LightGBM. - public string BoostingType { get; set; } - /// Specify the grow policy, which controls the way new nodes are added to the tree. - public string GrowPolicy { get; set; } - /// The learning rate for the training procedure. - public string LearningRate { get; set; } - /// Specify the Maximum number of discrete bins to bucket continuous features . - public string MaxBin { get; set; } - /// Specify the max depth to limit the tree depth explicitly. - public string MaxDepth { get; set; } - /// Specify the max leaves to limit the tree leaves explicitly. - public string MaxLeaves { get; set; } - /// The minimum number of data per leaf. - public string MinDataInLeaf { get; set; } - /// Minimum loss reduction required to make a further partition on a leaf node of the tree. - public string MinSplitGain { get; set; } - /// The name of the model to train. - public string ModelName { get; set; } - /// Specify the number of trees (or rounds) in an model. - public string NEstimators { get; set; } - /// Specify the number of leaves. - public string NumLeaves { get; set; } - /// The name of the preprocessor to use. - public string PreprocessorName { get; set; } - /// L1 regularization term on weights. - public string RegAlpha { get; set; } - /// L2 regularization term on weights. - public string RegLambda { get; set; } - /// Subsample ratio of the training instance. - public string Subsample { get; set; } - /// Frequency of subsample. - public string SubsampleFreq { get; set; } - /// Specify the tree method. - public string TreeMethod { get; set; } - /// If true, center before scaling the data with StandardScalar. - public string WithMean { get; set; } - /// If true, scaling the data with Unit Variance with StandardScalar. - public string WithStd { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs deleted file mode 100644 index fa9260d3aa5b5..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TableSweepSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EarlyTermination)) - { - if (EarlyTermination != null) - { - writer.WritePropertyName("earlyTermination"u8); - writer.WriteObjectValue(EarlyTermination, options); - } - else - { - writer.WriteNull("earlyTermination"); - } - } - writer.WritePropertyName("samplingAlgorithm"u8); - writer.WriteStringValue(SamplingAlgorithm.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TableSweepSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableSweepSettings(document.RootElement, options); - } - - internal static TableSweepSettings DeserializeTableSweepSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MachineLearningEarlyTerminationPolicy earlyTermination = default; - SamplingAlgorithmType samplingAlgorithm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("earlyTermination"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - earlyTermination = null; - continue; - } - earlyTermination = MachineLearningEarlyTerminationPolicy.DeserializeMachineLearningEarlyTerminationPolicy(property.Value, options); - continue; - } - if (property.NameEquals("samplingAlgorithm"u8)) - { - samplingAlgorithm = new SamplingAlgorithmType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableSweepSettings(earlyTermination, samplingAlgorithm, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support writing '{options.Format}' format."); - } - } - - TableSweepSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTableSweepSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableSweepSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs deleted file mode 100644 index b9051d2ef6952..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableSweepSettings.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// The TableSweepSettings. - public partial class TableSweepSettings - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// [Required] Type of sampling algorithm. - public TableSweepSettings(SamplingAlgorithmType samplingAlgorithm) - { - SamplingAlgorithm = samplingAlgorithm; - } - - /// Initializes a new instance of . - /// - /// Type of early termination policy for the sweeping job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// [Required] Type of sampling algorithm. - /// Keeps track of any properties unknown to the library. - internal TableSweepSettings(MachineLearningEarlyTerminationPolicy earlyTermination, SamplingAlgorithmType samplingAlgorithm, IDictionary serializedAdditionalRawData) - { - EarlyTermination = earlyTermination; - SamplingAlgorithm = samplingAlgorithm; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TableSweepSettings() - { - } - - /// - /// Type of early termination policy for the sweeping job. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public MachineLearningEarlyTerminationPolicy EarlyTermination { get; set; } - /// [Required] Type of sampling algorithm. - public SamplingAlgorithmType SamplingAlgorithm { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs index 86389889a0bef..66488dcaf71da 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs @@ -53,26 +53,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("maxCoresPerTrial"u8); writer.WriteNumberValue(MaxCoresPerTrial.Value); } - if (Optional.IsDefined(MaxNodes)) - { - writer.WritePropertyName("maxNodes"u8); - writer.WriteNumberValue(MaxNodes.Value); - } if (Optional.IsDefined(MaxTrials)) { writer.WritePropertyName("maxTrials"u8); writer.WriteNumberValue(MaxTrials.Value); } - if (Optional.IsDefined(SweepConcurrentTrials)) - { - writer.WritePropertyName("sweepConcurrentTrials"u8); - writer.WriteNumberValue(SweepConcurrentTrials.Value); - } - if (Optional.IsDefined(SweepTrials)) - { - writer.WritePropertyName("sweepTrials"u8); - writer.WriteNumberValue(SweepTrials.Value); - } if (Optional.IsDefined(Timeout)) { writer.WritePropertyName("timeout"u8); @@ -125,10 +110,7 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings double? exitScore = default; int? maxConcurrentTrials = default; int? maxCoresPerTrial = default; - int? maxNodes = default; int? maxTrials = default; - int? sweepConcurrentTrials = default; - int? sweepTrials = default; TimeSpan? timeout = default; TimeSpan? trialTimeout = default; IDictionary serializedAdditionalRawData = default; @@ -172,15 +154,6 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings maxCoresPerTrial = property.Value.GetInt32(); continue; } - if (property.NameEquals("maxNodes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxNodes = property.Value.GetInt32(); - continue; - } if (property.NameEquals("maxTrials"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -190,24 +163,6 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings maxTrials = property.Value.GetInt32(); continue; } - if (property.NameEquals("sweepConcurrentTrials"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sweepConcurrentTrials = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("sweepTrials"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sweepTrials = property.Value.GetInt32(); - continue; - } if (property.NameEquals("timeout"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -237,10 +192,7 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings exitScore, maxConcurrentTrials, maxCoresPerTrial, - maxNodes, maxTrials, - sweepConcurrentTrials, - sweepTrials, timeout, trialTimeout, serializedAdditionalRawData); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs index 161c66504ac4e..f58865b884080 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs @@ -55,23 +55,17 @@ public TableVerticalLimitSettings() /// Exit score for the AutoML job. /// Maximum Concurrent iterations. /// Max cores per iteration. - /// Maximum nodes to use for the experiment. /// Number of iterations. - /// Number of concurrent sweeping runs that user wants to trigger. - /// Number of sweeping runs that user wants to trigger. /// AutoML job timeout. /// Iteration timeout. /// Keeps track of any properties unknown to the library. - internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitScore, int? maxConcurrentTrials, int? maxCoresPerTrial, int? maxNodes, int? maxTrials, int? sweepConcurrentTrials, int? sweepTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) + internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitScore, int? maxConcurrentTrials, int? maxCoresPerTrial, int? maxTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) { EnableEarlyTermination = enableEarlyTermination; ExitScore = exitScore; MaxConcurrentTrials = maxConcurrentTrials; MaxCoresPerTrial = maxCoresPerTrial; - MaxNodes = maxNodes; MaxTrials = maxTrials; - SweepConcurrentTrials = sweepConcurrentTrials; - SweepTrials = sweepTrials; Timeout = timeout; TrialTimeout = trialTimeout; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -85,14 +79,8 @@ internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitSc public int? MaxConcurrentTrials { get; set; } /// Max cores per iteration. public int? MaxCoresPerTrial { get; set; } - /// Maximum nodes to use for the experiment. - public int? MaxNodes { get; set; } /// Number of iterations. public int? MaxTrials { get; set; } - /// Number of concurrent sweeping runs that user wants to trigger. - public int? SweepConcurrentTrials { get; set; } - /// Number of sweeping runs that user wants to trigger. - public int? SweepTrials { get; set; } /// AutoML job timeout. public TimeSpan? Timeout { get; set; } /// Iteration timeout. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs deleted file mode 100644 index aba8b04118684..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextAnnotationType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Annotation type of text data. - public readonly partial struct TextAnnotationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TextAnnotationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ClassificationValue = "Classification"; - private const string NamedEntityRecognitionValue = "NamedEntityRecognition"; - - /// Classification. - public static TextAnnotationType Classification { get; } = new TextAnnotationType(ClassificationValue); - /// NamedEntityRecognition. - public static TextAnnotationType NamedEntityRecognition { get; } = new TextAnnotationType(NamedEntityRecognitionValue); - /// Determines if two values are the same. - public static bool operator ==(TextAnnotationType left, TextAnnotationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TextAnnotationType left, TextAnnotationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TextAnnotationType(string value) => new TextAnnotationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TextAnnotationType other && Equals(other); - /// - public bool Equals(TextAnnotationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs index 28b094eb612bd..4a46ae7bc00da 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,35 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("limitSettings"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -169,10 +128,7 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele } ClassificationPrimaryMetric? primaryMetric = default; NlpVerticalFeaturizationSettings featurizationSettings = default; - NlpFixedParameters fixedParameters = default; NlpVerticalLimitSettings limitSettings = default; - IList searchSpace = default; - NlpSweepSettings sweepSettings = default; MachineLearningTableJobInput validationData = default; MachineLearningLogVerbosity? logVerbosity = default; string targetColumnName = default; @@ -201,16 +157,6 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = NlpFixedParameters.DeserializeNlpFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,31 +167,6 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NlpParameterSubspace.DeserializeNlpParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = NlpSweepSettings.DeserializeNlpSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -299,10 +220,7 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele serializedAdditionalRawData, primaryMetric, featurizationSettings, - fixedParameters, limitSettings, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs index 26c16340bc85d..22cf9fcea45fb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs @@ -23,7 +23,6 @@ public TextClassification(MachineLearningTableJobInput trainingData) : base(trai { Argument.AssertNotNull(trainingData, nameof(trainingData)); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.TextClassification; } @@ -38,19 +37,13 @@ public TextClassification(MachineLearningTableJobInput trainingData) : base(trai /// Keeps track of any properties unknown to the library. /// Primary metric for Text-Classification task. /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. - internal TextClassification(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpFixedParameters fixedParameters, NlpVerticalLimitSettings limitSettings, IList searchSpace, NlpSweepSettings sweepSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal TextClassification(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; ValidationData = validationData; TaskType = taskType; } @@ -76,14 +69,8 @@ public string FeaturizationDatasetLanguage } } - /// Model/training parameters that will remain constant throughout training. - public NlpFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public NlpVerticalLimitSettings LimitSettings { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public NlpSweepSettings SweepSettings { get; set; } /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs index 5f97e68452b38..2b00747058a1b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,35 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("limitSettings"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -169,10 +128,7 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil } ClassificationMultilabelPrimaryMetric? primaryMetric = default; NlpVerticalFeaturizationSettings featurizationSettings = default; - NlpFixedParameters fixedParameters = default; NlpVerticalLimitSettings limitSettings = default; - IList searchSpace = default; - NlpSweepSettings sweepSettings = default; MachineLearningTableJobInput validationData = default; MachineLearningLogVerbosity? logVerbosity = default; string targetColumnName = default; @@ -201,16 +157,6 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = NlpFixedParameters.DeserializeNlpFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,31 +167,6 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NlpParameterSubspace.DeserializeNlpParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = NlpSweepSettings.DeserializeNlpSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -299,10 +220,7 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil serializedAdditionalRawData, primaryMetric, featurizationSettings, - fixedParameters, limitSettings, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs index 3baca6fe2380d..64180f34e8eb8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs @@ -23,7 +23,6 @@ public TextClassificationMultilabel(MachineLearningTableJobInput trainingData) : { Argument.AssertNotNull(trainingData, nameof(trainingData)); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.TextClassificationMultilabel; } @@ -41,19 +40,13 @@ public TextClassificationMultilabel(MachineLearningTableJobInput trainingData) : /// Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. - internal TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationMultilabelPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpFixedParameters fixedParameters, NlpVerticalLimitSettings limitSettings, IList searchSpace, NlpSweepSettings sweepSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationMultilabelPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; ValidationData = validationData; TaskType = taskType; } @@ -82,14 +75,8 @@ public string FeaturizationDatasetLanguage } } - /// Model/training parameters that will remain constant throughout training. - public NlpFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public NlpVerticalLimitSettings LimitSettings { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public NlpSweepSettings SweepSettings { get; set; } /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs index b829899c00fb1..8cf7134c1e389 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs @@ -43,18 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WriteNull("featurizationSettings"); } } - if (Optional.IsDefined(FixedParameters)) - { - if (FixedParameters != null) - { - writer.WritePropertyName("fixedParameters"u8); - writer.WriteObjectValue(FixedParameters, options); - } - else - { - writer.WriteNull("fixedParameters"); - } - } if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,35 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WriteNull("limitSettings"); } } - if (Optional.IsCollectionDefined(SearchSpace)) - { - if (SearchSpace != null) - { - writer.WritePropertyName("searchSpace"u8); - writer.WriteStartArray(); - foreach (var item in SearchSpace) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("searchSpace"); - } - } - if (Optional.IsDefined(SweepSettings)) - { - if (SweepSettings != null) - { - writer.WritePropertyName("sweepSettings"u8); - writer.WriteObjectValue(SweepSettings, options); - } - else - { - writer.WriteNull("sweepSettings"); - } - } if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -169,10 +128,7 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite } ClassificationPrimaryMetric? primaryMetric = default; NlpVerticalFeaturizationSettings featurizationSettings = default; - NlpFixedParameters fixedParameters = default; NlpVerticalLimitSettings limitSettings = default; - IList searchSpace = default; - NlpSweepSettings sweepSettings = default; MachineLearningTableJobInput validationData = default; MachineLearningLogVerbosity? logVerbosity = default; string targetColumnName = default; @@ -201,16 +157,6 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } - if (property.NameEquals("fixedParameters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fixedParameters = null; - continue; - } - fixedParameters = NlpFixedParameters.DeserializeNlpFixedParameters(property.Value, options); - continue; - } if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -221,31 +167,6 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } - if (property.NameEquals("searchSpace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchSpace = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NlpParameterSubspace.DeserializeNlpParameterSubspace(item, options)); - } - searchSpace = array; - continue; - } - if (property.NameEquals("sweepSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sweepSettings = null; - continue; - } - sweepSettings = NlpSweepSettings.DeserializeNlpSweepSettings(property.Value, options); - continue; - } if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -299,10 +220,7 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite serializedAdditionalRawData, primaryMetric, featurizationSettings, - fixedParameters, limitSettings, - searchSpace ?? new ChangeTrackingList(), - sweepSettings, validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs index 856be85a972da..0e7a659de83fc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs @@ -24,7 +24,6 @@ public TextNer(MachineLearningTableJobInput trainingData) : base(trainingData) { Argument.AssertNotNull(trainingData, nameof(trainingData)); - SearchSpace = new ChangeTrackingList(); TaskType = TaskType.TextNER; } @@ -42,19 +41,13 @@ public TextNer(MachineLearningTableJobInput trainingData) : base(trainingData) /// Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. /// /// Featurization inputs needed for AutoML job. - /// Model/training parameters that will remain constant throughout training. /// Execution constraints for AutoMLJob. - /// Search space for sampling different combinations of models and their hyperparameters. - /// Settings for model sweeping and hyperparameter tuning. /// Validation data inputs. - internal TextNer(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpFixedParameters fixedParameters, NlpVerticalLimitSettings limitSettings, IList searchSpace, NlpSweepSettings sweepSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + internal TextNer(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) { PrimaryMetric = primaryMetric; FeaturizationSettings = featurizationSettings; - FixedParameters = fixedParameters; LimitSettings = limitSettings; - SearchSpace = searchSpace; - SweepSettings = sweepSettings; ValidationData = validationData; TaskType = taskType; } @@ -83,14 +76,8 @@ public string FeaturizationDatasetLanguage } } - /// Model/training parameters that will remain constant throughout training. - public NlpFixedParameters FixedParameters { get; set; } /// Execution constraints for AutoMLJob. public NlpVerticalLimitSettings LimitSettings { get; set; } - /// Search space for sampling different combinations of models and their hyperparameters. - public IList SearchSpace { get; set; } - /// Settings for model sweeping and hyperparameter tuning. - public NlpSweepSettings SweepSettings { get; set; } /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs deleted file mode 100644 index 46f8ec943f312..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TrainingMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Training mode dictates whether to use distributed training or not. - public readonly partial struct TrainingMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TrainingMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AutoValue = "Auto"; - private const string DistributedValue = "Distributed"; - private const string NonDistributedValue = "NonDistributed"; - - /// Auto mode. - public static TrainingMode Auto { get; } = new TrainingMode(AutoValue); - /// Distributed training mode. - public static TrainingMode Distributed { get; } = new TrainingMode(DistributedValue); - /// Non distributed training mode. - public static TrainingMode NonDistributed { get; } = new TrainingMode(NonDistributedValue); - /// Determines if two values are the same. - public static bool operator ==(TrainingMode left, TrainingMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TrainingMode left, TrainingMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TrainingMode(string value) => new TrainingMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TrainingMode other && Equals(other); - /// - public bool Equals(TrainingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs deleted file mode 100644 index 118463272f30b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - public partial class TritonInferencingServer : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(InferenceConfiguration)) - { - if (InferenceConfiguration != null) - { - writer.WritePropertyName("inferenceConfiguration"u8); - writer.WriteObjectValue(InferenceConfiguration, options); - } - else - { - writer.WriteNull("inferenceConfiguration"); - } - } - writer.WritePropertyName("serverType"u8); - writer.WriteStringValue(ServerType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - TritonInferencingServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTritonInferencingServer(document.RootElement, options); - } - - internal static TritonInferencingServer DeserializeTritonInferencingServer(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OnlineInferenceConfiguration inferenceConfiguration = default; - InferencingServerType serverType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inferenceConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - inferenceConfiguration = null; - continue; - } - inferenceConfiguration = OnlineInferenceConfiguration.DeserializeOnlineInferenceConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("serverType"u8)) - { - serverType = new InferencingServerType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TritonInferencingServer(serverType, serializedAdditionalRawData, inferenceConfiguration); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support writing '{options.Format}' format."); - } - } - - TritonInferencingServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTritonInferencingServer(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TritonInferencingServer)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs deleted file mode 100644 index d48141a65f9f6..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TritonInferencingServer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Triton inferencing server configurations. - public partial class TritonInferencingServer : InferencingServer - { - /// Initializes a new instance of . - public TritonInferencingServer() - { - ServerType = InferencingServerType.Triton; - } - - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - /// Inference configuration for Triton. - internal TritonInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData, OnlineInferenceConfiguration inferenceConfiguration) : base(serverType, serializedAdditionalRawData) - { - InferenceConfiguration = inferenceConfiguration; - ServerType = serverType; - } - - /// Inference configuration for Triton. - public OnlineInferenceConfiguration InferenceConfiguration { get; set; } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs deleted file mode 100644 index 8fe73f4ccc656..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownBaseEnvironmentSource.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of BaseEnvironmentSource. - internal partial class UnknownBaseEnvironmentSource : BaseEnvironmentSource - { - /// Initializes a new instance of . - /// [Required] Base environment type. - /// Keeps track of any properties unknown to the library. - internal UnknownBaseEnvironmentSource(BaseEnvironmentSourceType baseEnvironmentSourceType, IDictionary serializedAdditionalRawData) : base(baseEnvironmentSourceType, serializedAdditionalRawData) - { - BaseEnvironmentSourceType = baseEnvironmentSourceType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownBaseEnvironmentSource() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs deleted file mode 100644 index e7d4845c6272d..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - internal partial class UnknownDataImportSource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Connection)) - { - if (Connection != null) - { - writer.WritePropertyName("connection"u8); - writer.WriteStringValue(Connection); - } - else - { - writer.WriteNull("connection"); - } - } - writer.WritePropertyName("sourceType"u8); - writer.WriteStringValue(SourceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataImportSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataImportSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataImportSource(document.RootElement, options); - } - - internal static UnknownDataImportSource DeserializeUnknownDataImportSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string connection = default; - DataImportSourceType sourceType = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connection = null; - continue; - } - connection = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceType"u8)) - { - sourceType = new DataImportSourceType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownDataImportSource(connection, sourceType, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support writing '{options.Format}' format."); - } - } - - DataImportSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataImportSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataImportSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs deleted file mode 100644 index 1c2608977c6c2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataImportSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of DataImportSource. - internal partial class UnknownDataImportSource : DataImportSource - { - /// Initializes a new instance of . - /// Workspace connection for data import source storage. - /// [Required] Specifies the type of data. - /// Keeps track of any properties unknown to the library. - internal UnknownDataImportSource(string connection, DataImportSourceType sourceType, IDictionary serializedAdditionalRawData) : base(connection, sourceType, serializedAdditionalRawData) - { - SourceType = sourceType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownDataImportSource() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.Serialization.cs similarity index 59% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.Serialization.cs index 3be4b52069960..5605f3efb8353 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobPatch.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.Serialization.cs @@ -13,24 +13,21 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MachineLearningJobPatch : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownDataReferenceCredential : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +46,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndObject(); } - MachineLearningJobPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataReferenceCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningJobPatch(document.RootElement, options); + return DeserializeDataReferenceCredential(document.RootElement, options); } - internal static MachineLearningJobPatch DeserializeMachineLearningJobPatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownDataReferenceCredential DeserializeUnknownDataReferenceCredential(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +66,14 @@ internal static MachineLearningJobPatch DeserializeMachineLearningJobPatch(JsonE { return null; } - PartialJobBase properties = default; + DataReferenceCredentialType credentialType = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (property.NameEquals("credentialType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = PartialJobBase.DeserializePartialJobBase(property.Value, options); + credentialType = new DataReferenceCredentialType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -89,38 +82,38 @@ internal static MachineLearningJobPatch DeserializeMachineLearningJobPatch(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningJobPatch(properties, serializedAdditionalRawData); + return new UnknownDataReferenceCredential(credentialType, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support writing '{options.Format}' format."); } } - MachineLearningJobPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DataReferenceCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMachineLearningJobPatch(document.RootElement, options); + return DeserializeDataReferenceCredential(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MachineLearningJobPatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataReferenceCredential)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs new file mode 100644 index 0000000000000..807b4de99b805 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataReferenceCredential.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of DataReferenceCredential. + internal partial class UnknownDataReferenceCredential : DataReferenceCredential + { + /// Initializes a new instance of . + /// [Required] Credential type used to authentication with storage. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReferenceCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData) : base(credentialType, serializedAdditionalRawData) + { + CredentialType = credentialType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReferenceCredential() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs index 8e2eb109f7998..cebe9f2ce6ae7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs @@ -30,42 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } - if (Optional.IsDefined(Stage)) - { - if (Stage != null) - { - writer.WritePropertyName("stage"u8); - writer.WriteStringValue(Stage); - } - else - { - writer.WriteNull("stage"); - } - } - if (Optional.IsDefined(AutoDeleteSetting)) - { - if (AutoDeleteSetting != null) - { - writer.WritePropertyName("autoDeleteSetting"u8); - writer.WriteObjectValue(AutoDeleteSetting, options); - } - else - { - writer.WriteNull("autoDeleteSetting"); - } - } if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -164,9 +128,6 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle } MachineLearningDataType dataType = "Unknown"; Uri dataUri = default; - IntellectualProperty intellectualProperty = default; - string stage = default; - AutoDeleteSetting autoDeleteSetting = default; bool? isAnonymous = default; bool? isArchived = default; string description = default; @@ -186,36 +147,6 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle dataUri = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } - if (property.NameEquals("stage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - stage = null; - continue; - } - stage = property.Value.GetString(); - continue; - } - if (property.NameEquals("autoDeleteSetting"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - autoDeleteSetting = null; - continue; - } - autoDeleteSetting = AutoDeleteSetting.DeserializeAutoDeleteSetting(property.Value, options); - continue; - } if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -285,13 +216,10 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle properties ?? new ChangeTrackingDictionary(), tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, - autoDeleteSetting, isAnonymous, isArchived, dataType, - dataUri, - intellectualProperty, - stage); + dataUri); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs index 0ab061b4dd34c..c11919d2d430b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs @@ -18,14 +18,11 @@ internal partial class UnknownDataVersionBase : MachineLearningDataVersionProper /// The asset property dictionary. /// Tag dictionary. Tags can be added, removed, and updated. /// Keeps track of any properties unknown to the library. - /// Specifies the lifecycle setting of managed data asset. - /// If the name version are system generated (anonymous registration). For types where Stage is defined, when Stage is provided it will be used to populate IsAnonymous. - /// Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived. + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. - /// Intellectual Property details. Used if data is an Intellectual Property. - /// Stage in the data lifecycle assigned to this data asset. - internal UnknownDataVersionBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, AutoDeleteSetting autoDeleteSetting, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IntellectualProperty intellectualProperty, string stage) : base(description, properties, tags, serializedAdditionalRawData, autoDeleteSetting, isAnonymous, isArchived, dataType, dataUri, intellectualProperty, stage) + internal UnknownDataVersionBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs index 828c79014ddb1..ac882a7cc3643 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs @@ -30,18 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Credentials, options); writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); - if (Optional.IsDefined(IntellectualProperty)) - { - if (IntellectualProperty != null) - { - writer.WritePropertyName("intellectualProperty"u8); - writer.WriteObjectValue(IntellectualProperty, options); - } - else - { - writer.WriteNull("intellectualProperty"); - } - } if (options.Format != "W" && Optional.IsDefined(IsDefault)) { writer.WritePropertyName("isDefault"u8); @@ -135,7 +123,6 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element } MachineLearningDatastoreCredentials credentials = default; DatastoreType datastoreType = "Unknown"; - IntellectualProperty intellectualProperty = default; bool? isDefault = default; string description = default; IDictionary properties = default; @@ -154,16 +141,6 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element datastoreType = new DatastoreType(property.Value.GetString()); continue; } - if (property.NameEquals("intellectualProperty"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - intellectualProperty = null; - continue; - } - intellectualProperty = IntellectualProperty.DeserializeIntellectualProperty(property.Value, options); - continue; - } if (property.NameEquals("isDefault"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -226,7 +203,6 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element serializedAdditionalRawData, credentials, datastoreType, - intellectualProperty, isDefault); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs index def0464645468..bf51703a36caf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs @@ -21,12 +21,11 @@ internal partial class UnknownDatastore : MachineLearningDatastoreProperties /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , and . /// /// [Required] Storage type backing the datastore. - /// Intellectual Property details. /// Readonly property to indicate if datastore is the workspace default datastore. - internal UnknownDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, IntellectualProperty intellectualProperty, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, intellectualProperty, isDefault) + internal UnknownDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) { DatastoreType = datastoreType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..559203e2f1ed6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static UnknownEndpointDeploymentResourceProperties DeserializeUnknownEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEndpointDeploymentResourceProperties(failureReason, provisioningState, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs new file mode 100644 index 0000000000000..24651ee23ad78 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of EndpointDeploymentResourceProperties. + internal partial class UnknownEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + internal UnknownEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEndpointDeploymentResourceProperties() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..83517db80a0ad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + + internal static UnknownEndpointResourceProperties DeserializeUnknownEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = "Unknown"; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs new file mode 100644 index 0000000000000..834f1d27d801c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of EndpointResourceProperties. + internal partial class UnknownEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal UnknownEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEndpointResourceProperties() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs deleted file mode 100644 index 6af3fd747ceab..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.Serialization.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - internal partial class UnknownExportSummary : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - if (EndOn != null) - { - writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endDateTime"); - } - } - if (options.Format != "W" && Optional.IsDefined(ExportedRowCount)) - { - if (ExportedRowCount != null) - { - writer.WritePropertyName("exportedRowCount"u8); - writer.WriteNumberValue(ExportedRowCount.Value); - } - else - { - writer.WriteNull("exportedRowCount"); - } - } - writer.WritePropertyName("format"u8); - writer.WriteStringValue(Format.ToString()); - if (options.Format != "W" && Optional.IsDefined(LabelingJobId)) - { - if (LabelingJobId != null) - { - writer.WritePropertyName("labelingJobId"u8); - writer.WriteStringValue(LabelingJobId); - } - else - { - writer.WriteNull("labelingJobId"); - } - } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - if (StartOn != null) - { - writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - else - { - writer.WriteNull("startDateTime"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ExportSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportSummary)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportSummary(document.RootElement, options); - } - - internal static UnknownExportSummary DeserializeUnknownExportSummary(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset? endDateTime = default; - long? exportedRowCount = default; - ExportFormatType format = "Unknown"; - string labelingJobId = default; - DateTimeOffset? startDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("endDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - endDateTime = null; - continue; - } - endDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("exportedRowCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - exportedRowCount = null; - continue; - } - exportedRowCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("format"u8)) - { - format = new ExportFormatType(property.Value.GetString()); - continue; - } - if (property.NameEquals("labelingJobId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - labelingJobId = null; - continue; - } - labelingJobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("startDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - startDateTime = null; - continue; - } - startDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownExportSummary( - endDateTime, - exportedRowCount, - format, - labelingJobId, - startDateTime, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support writing '{options.Format}' format."); - } - } - - ExportSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportSummary(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ExportSummary)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs deleted file mode 100644 index f7a61c5559955..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownExportSummary.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of ExportSummary. - internal partial class UnknownExportSummary : ExportSummary - { - /// Initializes a new instance of . - /// The time when the export was completed. - /// The total number of labeled datapoints exported. - /// [Required] The format of exported labels, also as the discriminator. - /// Name and identifier of the job containing exported labels. - /// The time when the export was requested. - /// Keeps track of any properties unknown to the library. - internal UnknownExportSummary(DateTimeOffset? endOn, long? exportedRowCount, ExportFormatType format, string labelingJobId, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData) : base(endOn, exportedRowCount, format, labelingJobId, startOn, serializedAdditionalRawData) - { - Format = format; - } - - /// Initializes a new instance of for deserialization. - internal UnknownExportSummary() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs new file mode 100644 index 0000000000000..ab85d7c1c6d86 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownFineTuningVertical : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningVertical IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningVertical(document.RootElement, options); + } + + internal static UnknownFineTuningVertical DeserializeUnknownFineTuningVertical(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ModelProvider modelProvider = "Unknown"; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFineTuningVertical( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{options.Format}' format."); + } + } + + FineTuningVertical IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningVertical(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs new file mode 100644 index 0000000000000..e33e8b3ad11a7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of FineTuningVertical. + internal partial class UnknownFineTuningVertical : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + internal UnknownFineTuningVertical(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFineTuningVertical() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs deleted file mode 100644 index 2810ac9cc9638..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownInferencingServer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of InferencingServer. - internal partial class UnknownInferencingServer : InferencingServer - { - /// Initializes a new instance of . - /// [Required] Inferencing server type for various targets. - /// Keeps track of any properties unknown to the library. - internal UnknownInferencingServer(InferencingServerType serverType, IDictionary serializedAdditionalRawData) : base(serverType, serializedAdditionalRawData) - { - ServerType = serverType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownInferencingServer() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs index d6970a4c5da0a..fc6f6c9433706 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs @@ -98,24 +98,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("notificationSetting"); } } - if (Optional.IsCollectionDefined(SecretsConfiguration)) - { - if (SecretsConfiguration != null) - { - writer.WritePropertyName("secretsConfiguration"u8); - writer.WriteStartObject(); - foreach (var item in SecretsConfiguration) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); - } - writer.WriteEndObject(); - } - else - { - writer.WriteNull("secretsConfiguration"); - } - } if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -233,7 +215,6 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo bool? isArchived = default; JobType jobType = "Unknown"; NotificationSetting notificationSetting = default; - IDictionary secretsConfiguration = default; IDictionary services = default; MachineLearningJobStatus? status = default; string description = default; @@ -312,21 +293,6 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); continue; } - if (property.NameEquals("secretsConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - secretsConfiguration = null; - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecretConfiguration.DeserializeSecretConfiguration(property0.Value, options)); - } - secretsConfiguration = dictionary; - continue; - } if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -410,7 +376,6 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo isArchived, jobType, notificationSetting, - secretsConfiguration ?? new ChangeTrackingDictionary(), services ?? new ChangeTrackingDictionary(), status); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs index 15b377f5893a4..468a345f2b3d9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs @@ -32,13 +32,12 @@ internal partial class UnknownJobBase : MachineLearningJobProperties /// Is the asset archived?. /// [Required] Specifies the type of job. /// Notification setting for the job. - /// Configuration for secrets to be made available during runtime. /// /// List of JobEndpoints. /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. /// /// Status of the job. - internal UnknownJobBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary secretsConfiguration, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, secretsConfiguration, services, status) + internal UnknownJobBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) { JobType = jobType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs deleted file mode 100644 index 324ecb95759c2..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownLabelingJobMediaProperties.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of LabelingJobMediaProperties. - internal partial class UnknownLabelingJobMediaProperties : LabelingJobMediaProperties - { - /// Initializes a new instance of . - /// [Required] Media type of the job. - /// Keeps track of any properties unknown to the library. - internal UnknownLabelingJobMediaProperties(MediaType mediaType, IDictionary serializedAdditionalRawData) : base(mediaType, serializedAdditionalRawData) - { - MediaType = mediaType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownLabelingJobMediaProperties() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs deleted file mode 100644 index 3d8f7b2682d5b..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMLAssistConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of MLAssistConfiguration. - internal partial class UnknownMLAssistConfiguration : MachineLearningAssistConfiguration - { - /// Initializes a new instance of . - /// [Required] Indicates whether MLAssist feature is enabled. - /// Keeps track of any properties unknown to the library. - internal UnknownMLAssistConfiguration(MLAssistConfigurationType mlAssist, IDictionary serializedAdditionalRawData) : base(mlAssist, serializedAdditionalRawData) - { - MlAssist = mlAssist; - } - - /// Initializes a new instance of for deserialization. - internal UnknownMLAssistConfiguration() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs deleted file mode 100644 index cb97de5bee8ac..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownModelPerformanceMetricThresholdBase.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of ModelPerformanceMetricThresholdBase. - internal partial class UnknownModelPerformanceMetricThresholdBase : ModelPerformanceMetricThresholdBase - { - /// Initializes a new instance of . - /// [Required] Specifies the data type of the metric threshold. - /// The threshold value. If null, a default value will be set depending on the selected metric. - /// Keeps track of any properties unknown to the library. - internal UnknownModelPerformanceMetricThresholdBase(MonitoringModelType modelType, MonitoringThreshold threshold, IDictionary serializedAdditionalRawData) : base(modelType, threshold, serializedAdditionalRawData) - { - ModelType = modelType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownModelPerformanceMetricThresholdBase() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs index 7bcf8358ede32..172f8914db322 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitorComputeIdentityBase.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.MachineLearning.Models internal partial class UnknownMonitorComputeIdentityBase : MonitorComputeIdentityBase { /// Initializes a new instance of . - /// [Required] Monitor compute identity type enum. + /// [Required] Specifies the type of identity to use within the monitoring jobs. /// Keeps track of any properties unknown to the library. internal UnknownMonitorComputeIdentityBase(MonitorComputeIdentityType computeIdentityType, IDictionary serializedAdditionalRawData) : base(computeIdentityType, serializedAdditionalRawData) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs deleted file mode 100644 index 82c6676e3cb31..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - internal partial class UnknownMonitoringAlertNotificationSettingsBase : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("alertNotificationType"u8); - writer.WriteStringValue(AlertNotificationType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoringAlertNotificationSettingsBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - - internal static UnknownMonitoringAlertNotificationSettingsBase DeserializeUnknownMonitoringAlertNotificationSettingsBase(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MonitoringAlertNotificationType alertNotificationType = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("alertNotificationType"u8)) - { - alertNotificationType = new MonitoringAlertNotificationType(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownMonitoringAlertNotificationSettingsBase(alertNotificationType, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support writing '{options.Format}' format."); - } - } - - MonitoringAlertNotificationSettingsBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringAlertNotificationSettingsBase(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoringAlertNotificationSettingsBase)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs deleted file mode 100644 index f8f7e9667ad62..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringAlertNotificationSettingsBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of MonitoringAlertNotificationSettingsBase. - internal partial class UnknownMonitoringAlertNotificationSettingsBase : MonitoringAlertNotificationSettingsBase - { - /// Initializes a new instance of . - /// [Required] Specifies the type of signal to monitor. - /// Keeps track of any properties unknown to the library. - internal UnknownMonitoringAlertNotificationSettingsBase(MonitoringAlertNotificationType alertNotificationType, IDictionary serializedAdditionalRawData) : base(alertNotificationType, serializedAdditionalRawData) - { - AlertNotificationType = alertNotificationType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownMonitoringAlertNotificationSettingsBase() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs index 2417936222c03..7283f86884741 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs @@ -26,10 +26,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) + if (Optional.IsCollectionDefined(NotificationTypes)) { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } } if (Optional.IsCollectionDefined(Properties)) { @@ -89,20 +101,26 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa { return null; } - MonitoringNotificationMode? mode = default; + IList notificationTypes = default; IDictionary properties = default; MonitoringSignalType signalType = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + notificationTypes = null; continue; } - mode = new MonitoringNotificationMode(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MonitoringNotificationType(item.GetString())); + } + notificationTypes = array; continue; } if (property.NameEquals("properties"u8)) @@ -131,7 +149,7 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownMonitoringSignalBase(mode, properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData); + return new UnknownMonitoringSignalBase(notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs index 43bdde03aed56..319fa731c4231 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.MachineLearning.Models internal partial class UnknownMonitoringSignalBase : MonitoringSignalBase { /// Initializes a new instance of . - /// The current notification mode for this signal. + /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// [Required] Specifies the type of signal to monitor. /// Keeps track of any properties unknown to the library. - internal UnknownMonitoringSignalBase(MonitoringNotificationMode? mode, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) : base(mode, properties, signalType, serializedAdditionalRawData) + internal UnknownMonitoringSignalBase(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) { SignalType = signalType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs index 7c600117275c7..118f2aec2ec1a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs @@ -16,7 +16,7 @@ internal partial class UnknownOnlineDeployment : MachineLearningOnlineDeployment /// Initializes a new instance of . /// Code configuration for the endpoint deployment. /// Description of the endpoint deployment. - /// ARM resource ID of the environment specification for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs index 40ff3b3f96601..f37a5172caa1e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs @@ -31,6 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -77,6 +87,7 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e return null; } OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = "Unknown"; IDictionary serializedAdditionalRawData = default; @@ -92,6 +103,20 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -112,7 +137,7 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownOutboundRule(category, status, type, serializedAdditionalRawData); + return new UnknownOutboundRule(category, parentRuleNames ?? new ChangeTrackingList(), status, type, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs index 57fa4aa447f2a..0299ae72a728f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs @@ -15,10 +15,11 @@ internal partial class UnknownOutboundRule : MachineLearningOutboundRule { /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. - internal UnknownOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal UnknownOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { OutboundRuleType = outboundRuleType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs deleted file mode 100644 index 4ac3906647885..0000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownPackageInputPathBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.MachineLearning.Models -{ - /// Unknown version of PackageInputPathBase. - internal partial class UnknownPackageInputPathBase : PackageInputPathBase - { - /// Initializes a new instance of . - /// [Required] Input path type for package inputs. - /// Keeps track of any properties unknown to the library. - internal UnknownPackageInputPathBase(InputPathType inputPathType, IDictionary serializedAdditionalRawData) : base(inputPathType, serializedAdditionalRawData) - { - InputPathType = inputPathType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownPackageInputPathBase() - { - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs index 359d565675e29..9f33a19c96dff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs @@ -33,28 +33,72 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } - if (Optional.IsDefined(Metadata)) + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Metadata); -#else - using (JsonDocument document = JsonDocument.Parse(Metadata)) + writer.WriteStartObject(); + foreach (var item in Metadata) { - JsonSerializer.Serialize(writer, document.RootElement); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } -#endif + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,9 +139,17 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa } MachineLearningConnectionAuthType authType = "Unknown"; MachineLearningConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; DateTimeOffset? expiryTime = default; - BinaryData metadata = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; string target = default; + bool? useWorkspaceManagedIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -116,6 +168,20 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa category = new MachineLearningConnectionCategory(property.Value.GetString()); continue; } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -125,13 +191,68 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa expiryTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - metadata = BinaryData.FromString(property.Value.GetRawText()); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; continue; } if (property.NameEquals("target"u8)) @@ -139,6 +260,15 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa target = property.Value.GetString(); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -148,9 +278,17 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa return new UnknownWorkspaceConnectionPropertiesV2( authType, category, + createdByWorkspaceArmId, + error, expiryTime, - metadata, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), target, + useWorkspaceManagedIdentity, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs index 7d76a432b512c..f7dd7a5f8e686 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.MachineLearning.Models { @@ -16,11 +17,19 @@ internal partial class UnknownWorkspaceConnectionPropertiesV2 : MachineLearningW /// Initializes a new instance of . /// Authentication type of the connection target. /// Category of the connection. + /// + /// /// - /// Any object. + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// /// + /// /// Keeps track of any properties unknown to the library. - internal UnknownWorkspaceConnectionPropertiesV2(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, DateTimeOffset? expiryOn, BinaryData metadata, string target, IDictionary serializedAdditionalRawData) : base(authType, category, expiryOn, metadata, target, serializedAdditionalRawData) + internal UnknownWorkspaceConnectionPropertiesV2(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.Serialization.cs similarity index 62% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.Serialization.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.Serialization.cs index 302dfa8132415..a125b7e123eb4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MLAssistConfigurationDisabled.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.ResourceManager.MachineLearning.Models { - public partial class MLAssistConfigurationDisabled : IUtf8JsonSerializable, IJsonModel + internal partial class WorkspaceConnectionAccountKey : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("mlAssist"u8); - writer.WriteStringValue(MlAssist.ToString()); + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,19 +49,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - MLAssistConfigurationDisabled IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + WorkspaceConnectionAccountKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMLAssistConfigurationDisabled(document.RootElement, options); + return DeserializeWorkspaceConnectionAccountKey(document.RootElement, options); } - internal static MLAssistConfigurationDisabled DeserializeMLAssistConfigurationDisabled(JsonElement element, ModelReaderWriterOptions options = null) + internal static WorkspaceConnectionAccountKey DeserializeWorkspaceConnectionAccountKey(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +69,14 @@ internal static MLAssistConfigurationDisabled DeserializeMLAssistConfigurationDi { return null; } - MLAssistConfigurationType mlAssist = default; + string key = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mlAssist"u8)) + if (property.NameEquals("key"u8)) { - mlAssist = new MLAssistConfigurationType(property.Value.GetString()); + key = property.Value.GetString(); continue; } if (options.Format != "W") @@ -82,38 +85,38 @@ internal static MLAssistConfigurationDisabled DeserializeMLAssistConfigurationDi } } serializedAdditionalRawData = rawDataDictionary; - return new MLAssistConfigurationDisabled(mlAssist, serializedAdditionalRawData); + return new WorkspaceConnectionAccountKey(key, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support writing '{options.Format}' format."); } } - MLAssistConfigurationDisabled IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + WorkspaceConnectionAccountKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMLAssistConfigurationDisabled(document.RootElement, options); + return DeserializeWorkspaceConnectionAccountKey(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MLAssistConfigurationDisabled)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(WorkspaceConnectionAccountKey)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs new file mode 100644 index 0000000000000..62cebdd9c425a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Account key object for workspace connection credential. + internal partial class WorkspaceConnectionAccountKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public WorkspaceConnectionAccountKey() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal WorkspaceConnectionAccountKey(string key, IDictionary serializedAdditionalRawData) + { + Key = key; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key. + public string Key { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs new file mode 100644 index 0000000000000..fe73571e482ea --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.Serialization.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class WorkspaceConnectionOAuth2 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthUri)) + { + writer.WritePropertyName("authUrl"u8); + writer.WriteStringValue(AuthUri.AbsoluteUri); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.Value); + } + if (Optional.IsDefined(ClientSecret)) + { + writer.WritePropertyName("clientSecret"u8); + writer.WriteStringValue(ClientSecret); + } + if (Optional.IsDefined(DeveloperToken)) + { + writer.WritePropertyName("developerToken"u8); + writer.WriteStringValue(DeveloperToken); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(RefreshToken)) + { + writer.WritePropertyName("refreshToken"u8); + writer.WriteStringValue(RefreshToken); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + WorkspaceConnectionOAuth2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkspaceConnectionOAuth2(document.RootElement, options); + } + + internal static WorkspaceConnectionOAuth2 DeserializeWorkspaceConnectionOAuth2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri authUrl = default; + Guid? clientId = default; + string clientSecret = default; + string developerToken = default; + string password = default; + string refreshToken = default; + Guid? tenantId = default; + string username = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("clientSecret"u8)) + { + clientSecret = property.Value.GetString(); + continue; + } + if (property.NameEquals("developerToken"u8)) + { + developerToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("refreshToken"u8)) + { + refreshToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkspaceConnectionOAuth2( + authUrl, + clientId, + clientSecret, + developerToken, + password, + refreshToken, + tenantId, + username, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support writing '{options.Format}' format."); + } + } + + WorkspaceConnectionOAuth2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkspaceConnectionOAuth2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkspaceConnectionOAuth2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs new file mode 100644 index 0000000000000..a69d9bbafc33f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionOAuth2.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + public partial class WorkspaceConnectionOAuth2 + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public WorkspaceConnectionOAuth2() + { + } + + /// Initializes a new instance of . + /// Required by Concur connection category. + /// Client id in the format of UUID. + /// + /// Required by GoogleAdWords connection category. + /// + /// + /// Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + /// where user needs to get RefreshToken offline + /// + /// Required by QuickBooks and Xero connection categories. + /// + /// Concur, ServiceNow auth server AccessToken grant type is 'Password' + /// which requires UsernamePassword + /// + /// Keeps track of any properties unknown to the library. + internal WorkspaceConnectionOAuth2(Uri authUri, Guid? clientId, string clientSecret, string developerToken, string password, string refreshToken, Guid? tenantId, string username, IDictionary serializedAdditionalRawData) + { + AuthUri = authUri; + ClientId = clientId; + ClientSecret = clientSecret; + DeveloperToken = developerToken; + Password = password; + RefreshToken = refreshToken; + TenantId = tenantId; + Username = username; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Required by Concur connection category. + public Uri AuthUri { get; set; } + /// Client id in the format of UUID. + public Guid? ClientId { get; set; } + /// Gets or sets the client secret. + public string ClientSecret { get; set; } + /// Required by GoogleAdWords connection category. + public string DeveloperToken { get; set; } + /// Gets or sets the password. + public string Password { get; set; } + /// + /// Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + /// where user needs to get RefreshToken offline + /// + public string RefreshToken { get; set; } + /// Required by QuickBooks and Xero connection categories. + public Guid? TenantId { get; set; } + /// + /// Concur, ServiceNow auth server AccessToken grant type is 'Password' + /// which requires UsernamePassword + /// + public string Username { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs new file mode 100644 index 0000000000000..36027b868ed6f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistItemPropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiBlocklistItemPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiBlocklistItemPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs new file mode 100644 index 0000000000000..b1a592d930f99 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a RaiBlocklistItemPropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRaiBlocklistItemPropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetRaiBlocklistItemPropertiesBasicResource method. + /// + public partial class RaiBlocklistItemPropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiBlocklistName. + /// The raiBlocklistItemName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly RaiBlocklistItemPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiBlocklists/raiBlocklistItems"; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistItemPropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResource(ArmClient client, RaiBlocklistItemPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiBlocklistItemPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..1d8680cc1a58e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRaiBlocklistItemPropertiesBasicResources method from an instance of . + /// + public partial class RaiBlocklistItemPropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics; + private readonly ConnectionRaiBlocklistItemsRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistItemPropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient = new ConnectionRaiBlocklistItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != RaiBlocklistPropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RaiBlocklistPropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItems_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistItemPropertiesBasicResource(Client, RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(e)), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics, Pipeline, "RaiBlocklistItemPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItems_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistItemPropertiesBasicResource(Client, RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(e)), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics, Pipeline, "RaiBlocklistItemPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..27ad8f63407d1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistItemPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiBlocklistItemPropertiesBasicResourceData DeserializeRaiBlocklistItemPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiBlocklistItemProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiBlocklistItemProperties.DeserializeRaiBlocklistItemProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..00a0b7a6f4a45 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the RaiBlocklistItemPropertiesBasicResource data model. + public partial class RaiBlocklistItemPropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// RAI Custom Blocklist Item properties. + /// is null. + public RaiBlocklistItemPropertiesBasicResourceData(RaiBlocklistItemProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist Item properties. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiBlocklistItemProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiBlocklistItemPropertiesBasicResourceData() + { + } + + /// RAI Custom Blocklist Item properties. + public RaiBlocklistItemProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs new file mode 100644 index 0000000000000..c51c34454ba5a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistPropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiBlocklistPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiBlocklistPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs new file mode 100644 index 0000000000000..4d08a466b7332 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a RaiBlocklistPropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRaiBlocklistPropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetRaiBlocklistPropertiesBasicResource method. + /// + public partial class RaiBlocklistPropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiBlocklistName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics; + private readonly ConnectionRaiBlocklistRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient; + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly RaiBlocklistPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiBlocklists"; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistPropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResource(ArmClient client, RaiBlocklistPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient = new ConnectionRaiBlocklistRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiBlocklistPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of RaiBlocklistItemPropertiesBasicResources in the RaiBlocklistPropertiesBasicResource. + /// An object representing collection of RaiBlocklistItemPropertiesBasicResources and their operations over a RaiBlocklistItemPropertiesBasicResource. + public virtual RaiBlocklistItemPropertiesBasicResourceCollection GetRaiBlocklistItemPropertiesBasicResources() + { + return GetCachedClient(client => new RaiBlocklistItemPropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRaiBlocklistItemPropertiesBasicResourceAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + return await GetRaiBlocklistItemPropertiesBasicResources().GetAsync(raiBlocklistItemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRaiBlocklistItemPropertiesBasicResource(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + return GetRaiBlocklistItemPropertiesBasicResources().Get(raiBlocklistItemName, cancellationToken); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_AddBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// is null. + public virtual async Task>> AddBulkConnectionRaiBlocklistItemAsync(WaitUntil waitUntil, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.AddBulkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation>(new IListOperationSource(), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAddBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_AddBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation> AddBulkConnectionRaiBlocklistItem(WaitUntil waitUntil, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.AddBulk(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MachineLearningArmOperation>(new IListOperationSource(), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAddBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_DeleteBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// is null. + public virtual async Task DeleteBulkConnectionRaiBlocklistItemAsync(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteBulkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_DeleteBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DeleteBulkConnectionRaiBlocklistItem(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteBulk(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs new file mode 100644 index 0000000000000..48406f8e6acb2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRaiBlocklistPropertiesBasicResources method from an instance of . + /// + public partial class RaiBlocklistPropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics; + private readonly ConnectionRaiBlocklistRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient; + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics; + private readonly ConnectionRaiBlocklistsRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistPropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistPropertiesBasicResource.ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient = new ConnectionRaiBlocklistRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistPropertiesBasicResource.ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient = new ConnectionRaiBlocklistsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists + /// + /// + /// Operation Id + /// ConnectionRaiBlocklists_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistPropertiesBasicResource(Client, RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(e)), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics, Pipeline, "RaiBlocklistPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists + /// + /// + /// Operation Id + /// ConnectionRaiBlocklists_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistPropertiesBasicResource(Client, RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(e)), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics, Pipeline, "RaiBlocklistPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..f8ec2150e080d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiBlocklistPropertiesBasicResourceData DeserializeRaiBlocklistPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiBlocklistProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiBlocklistProperties.DeserializeRaiBlocklistProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..02321fa00384d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the RaiBlocklistPropertiesBasicResource data model. + public partial class RaiBlocklistPropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// RAI Custom Blocklist properties. + /// is null. + public RaiBlocklistPropertiesBasicResourceData(RaiBlocklistProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist properties. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiBlocklistProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiBlocklistPropertiesBasicResourceData() + { + } + + /// RAI Custom Blocklist properties. + internal RaiBlocklistProperties Properties { get; set; } + /// Description of the block list. + public string RaiBlocklistDescription + { + get => Properties is null ? default : Properties.Description; + set + { + if (Properties is null) + Properties = new RaiBlocklistProperties(); + Properties.Description = value; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 0000000000000..575935991f15d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiPolicyPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiPolicyPropertiesBasicResourceData DeserializeRaiPolicyPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiPolicyProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiPolicyProperties.DeserializeRaiPolicyProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs new file mode 100644 index 0000000000000..e54e633289d48 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing the RaiPolicyPropertiesBasicResource data model. + /// Azure OpenAI Content Filters resource. + /// + public partial class RaiPolicyPropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure OpenAI Content Filters properties. + /// is null. + public RaiPolicyPropertiesBasicResourceData(RaiPolicyProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure OpenAI Content Filters properties. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiPolicyPropertiesBasicResourceData() + { + } + + /// Azure OpenAI Content Filters properties. + public RaiPolicyProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs index e1c2a6f919543..2d37db873e5aa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public BatchDeploymentsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs index 745facb4b1d89..6973a0ed69716 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs @@ -32,7 +32,7 @@ public BatchEndpointsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs index 468da629dd924..cf88c9fb923cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs @@ -32,7 +32,7 @@ public CodeContainersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs index d10ca4cf3d83c..cbdf1b1fbdbca 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs @@ -32,7 +32,7 @@ public CodeVersionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -518,6 +518,116 @@ public Response CreateOrUpdate(string subscripti } } + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/codes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/codes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + 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(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateCreateOrGetStartPendingUploadRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, PendingUploadRequestDto body) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs index 473d3b8fac54e..b29ddc95a602e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs @@ -32,7 +32,7 @@ public ComponentContainersRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs index b233e5457bc10..f29c4bf365399 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public ComponentVersionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -66,14 +66,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,10 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -125,18 +117,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -161,18 +152,17 @@ public async Task> ListAsyn /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -518,7 +508,117 @@ public Response CreateOrUpdate(string subsc } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/components/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/components/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + 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(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -526,7 +626,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -550,11 +650,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -562,7 +661,7 @@ public async Task> ListNext Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -588,11 +687,10 @@ public async Task> ListNext /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -600,7 +698,7 @@ public Response ListNextPage(string Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs index d780a7d792b4a..6be3cfe65d703 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs @@ -33,7 +33,7 @@ public ComputeRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -850,6 +850,111 @@ public Response ListKeys(string subscriptionId, s } } + internal RequestUriBuilder CreateUpdateDataMountsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateDataMounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateDataMountsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateDataMounts", false); + 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.WriteStartArray(); + foreach (var item in dataMounts) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update Data Mounts of a Machine Learning compute. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateDataMountsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var message = CreateUpdateDataMountsRequest(subscriptionId, resourceGroupName, workspaceName, computeName, dataMounts); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update Data Mounts of a Machine Learning compute. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateDataMounts(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var message = CreateUpdateDataMountsRequest(subscriptionId, resourceGroupName, workspaceName, computeName, dataMounts); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) { var uri = new RawRequestUriBuilder(); @@ -1226,6 +1331,208 @@ public Response UpdateIdleShutdownSetting(string subscriptionId, string resource } } + internal RequestUriBuilder CreateGetAllowedResizeSizesRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/getAllowedVmSizesForResize", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAllowedResizeSizesRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/getAllowedVmSizesForResize", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns supported virtual machine sizes for resize. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAllowedResizeSizesAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetAllowedResizeSizesRequest(subscriptionId, resourceGroupName, workspaceName, computeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineSizeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineSizeListResult.DeserializeVirtualMachineSizeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns supported virtual machine sizes for resize. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetAllowedResizeSizes(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetAllowedResizeSizesRequest(subscriptionId, resourceGroupName, workspaceName, computeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineSizeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineSizeListResult.DeserializeVirtualMachineSizeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateResizeRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/resize", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateResizeRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/resize", false); + 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(resizeSchema, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the size of a Compute Instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ResizeAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var message = CreateResizeRequest(subscriptionId, resourceGroupName, workspaceName, computeName, resizeSchema); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the size of a Compute Instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Resize(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var message = CreateResizeRequest(subscriptionId, resourceGroupName, workspaceName, computeName, resizeSchema); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs new file mode 100644 index 0000000000000..3c147dc255bd9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistItemRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistItemRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistItemRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateAddBulkRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/addRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddBulkRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/addRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteStartArray(); + foreach (var item in content) + { + content0.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content0.JsonWriter.WriteEndArray(); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task AddBulkAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateAddBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response AddBulk(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateAddBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteBulkRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/deleteRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteBulkRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/deleteRaiBlocklistItems", false); + 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(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(body); +#else + using (JsonDocument document = JsonDocument.Parse(body)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteBulkAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDeleteBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteBulk(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDeleteBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistItemPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistItemPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs new file mode 100644 index 0000000000000..adfea5970ca98 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistItemsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistItemsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistItemsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs new file mode 100644 index 0000000000000..e864bf0736a3c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs new file mode 100644 index 0000000000000..f095c94a47739 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs new file mode 100644 index 0000000000000..d5e783d43501f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs new file mode 100644 index 0000000000000..d885c9356a506 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs new file mode 100644 index 0000000000000..31f2b45cf56ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs @@ -0,0 +1,833 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListDeploymentsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDeploymentsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListDeploymentsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListDeployments(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Azure OpenAI connection deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Azure OpenAI connection deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get deployments under the Azure OpenAI connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get deployments under the Azure OpenAI connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update Azure OpenAI connection deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Azure OpenAI connection deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModels(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listConnectionModels", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listConnectionModels", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListModelsRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListModels(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListModelsRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDeploymentsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDeploymentsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListDeploymentsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListDeploymentsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModelsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs index 413c6a35027c6..0ea15c14eac33 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs @@ -32,7 +32,7 @@ public DataContainersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs index 5b8197f7be9be..6c47b332208e8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs @@ -32,11 +32,11 @@ public DataVersionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -70,14 +70,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -114,10 +110,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -137,18 +129,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -177,18 +168,17 @@ public async Task> ListAsync /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -534,7 +524,117 @@ public Response CreateOrUpdate(string subscripti } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/data/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/data/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + 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(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -542,7 +642,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, string tags, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -570,11 +670,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -582,7 +681,7 @@ public async Task> ListNextP Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -612,11 +711,10 @@ public async Task> ListNextP /// Continuation token for pagination. /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. - /// data stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, string tags = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -624,7 +722,7 @@ public Response ListNextPage(string n Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs index 210db8abd9ca6..e4ba7194d7c36 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs @@ -33,7 +33,7 @@ public DatastoresRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -517,7 +517,7 @@ public Response CreateOrUpdate(string subscription } } - internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -534,7 +534,7 @@ internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, st return uri; } - internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -553,6 +553,13 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } _userAgent.Apply(message); return message; } @@ -562,17 +569,18 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Datastore name. + /// Secret expiry information. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name); + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -593,17 +601,18 @@ public async Task> ListSecretsAsync(st /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Datastore name. + /// Secret expiry information. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListSecrets(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + public Response ListSecrets(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name); + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs new file mode 100644 index 0000000000000..ee46457e483b3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class EndpointDeploymentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointDeploymentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public EndpointDeploymentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetInWorkspaceRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + return uri; + } + + internal HttpMessage CreateGetInWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the workspace scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetInWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the workspace scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetInWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the endpoint resource scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the endpoint resource scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete endpoint deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete endpoint deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get deployments under endpoint resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get deployments under endpoint resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update endpoint deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update endpoint deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetInWorkspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetInWorkspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the workspace scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetInWorkspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the workspace scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetInWorkspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the endpoint resource scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the endpoint resource scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs new file mode 100644 index 0000000000000..2d7a12da48292 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class EndpointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public EndpointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (includeInferenceEndpoints != null) + { + uri.AppendQuery("includeInferenceEndpoints", includeInferenceEndpoints.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (includeInferenceEndpoints != null) + { + uri.AppendQuery("includeInferenceEndpoints", includeInferenceEndpoints.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List All the endpoints under this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List All the endpoints under this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update endpoint resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update endpoint resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List keys for the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointKeys.DeserializeEndpointKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List keys for the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointKeys.DeserializeEndpointKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModels(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/regenerateKey", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/regenerateKey", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Regenerate account keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AccountApiKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountApiKeys.DeserializeAccountApiKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Regenerate account keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AccountApiKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountApiKeys.DeserializeAccountApiKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List All the endpoints under this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List All the endpoints under this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the endpoint resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the endpoint resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModelsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs index 6a168be1d7c00..0509cbc13d5ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs @@ -32,7 +32,7 @@ public EnvironmentContainersRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs index de4007a7477b4..4a5b721fe16cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public EnvironmentVersionsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -66,14 +66,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,10 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -125,18 +117,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -161,18 +152,17 @@ public async Task> ListAs /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -518,7 +508,117 @@ public Response CreateOrUpdate(string sub } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/environments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/environments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/publish", false); + 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(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish version asset into registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// Version identifier. + /// Destination registry info. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -526,7 +626,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -550,11 +650,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -562,7 +661,7 @@ public async Task> ListNe Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -588,11 +687,10 @@ public async Task> ListNe /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -600,7 +698,7 @@ public Response ListNextPage(strin Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs index 3bb7e70e14144..cf7a5baef317d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs @@ -32,11 +32,11 @@ public FeaturesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -68,10 +68,18 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("description", description, true); } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,6 +114,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("description", description, true); } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -122,10 +138,12 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -133,7 +151,7 @@ public async Task> ListAsync(string Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -159,10 +177,12 @@ public async Task> ListAsync(string /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -170,7 +190,7 @@ public Response List(string subscriptionId, s Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -306,7 +326,7 @@ public Response Get(string subscriptionId, string re } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -314,7 +334,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip, string tags, string featureName, string description, MachineLearningListViewType? listViewType, int? pageSize) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -339,10 +359,12 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -351,7 +373,7 @@ public async Task> ListNextPageAsync Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -378,10 +400,12 @@ public async Task> ListNextPageAsync /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. /// feature name. /// Description of the featureset. + /// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. + /// Page size. /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string featuresetName, string featuresetVersion, string skip = null, string tags = null, string featureName = null, string description = null, MachineLearningListViewType? listViewType = null, int? pageSize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -390,7 +414,7 @@ public Response ListNextPage(string nextLink, Argument.AssertNotNullOrEmpty(featuresetName, nameof(featuresetName)); Argument.AssertNotNullOrEmpty(featuresetVersion, nameof(featuresetVersion)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, description, listViewType, pageSize); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs index 8ade59154d27d..a3934ce5090a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs @@ -32,7 +32,7 @@ public FeaturesetContainersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs index 694403afea8a8..8b592ad345354 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs @@ -32,7 +32,7 @@ public FeaturesetVersionsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -660,156 +660,6 @@ public Response Backfill(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateListMaterializationJobsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/featuresets/", false); - uri.AppendPath(name, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/listMaterializationJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skip != null) - { - uri.AppendQuery("$skip", skip, true); - } - if (filters != null) - { - uri.AppendQuery("filters", filters, true); - } - if (featureWindowStart != null) - { - uri.AppendQuery("featureWindowStart", featureWindowStart, true); - } - if (featureWindowEnd != null) - { - uri.AppendQuery("featureWindowEnd", featureWindowEnd, true); - } - return uri; - } - - internal HttpMessage CreateListMaterializationJobsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/featuresets/", false); - uri.AppendPath(name, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/listMaterializationJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skip != null) - { - uri.AppendQuery("$skip", skip, true); - } - if (filters != null) - { - uri.AppendQuery("filters", filters, true); - } - if (featureWindowStart != null) - { - uri.AppendQuery("featureWindowStart", featureWindowStart, true); - } - if (featureWindowEnd != null) - { - uri.AppendQuery("featureWindowEnd", featureWindowEnd, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List materialization Jobs. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListMaterializationJobsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsRequest(subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List materialization Jobs. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMaterializationJobs(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsRequest(subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string tags, MachineLearningListViewType? listViewType, int? pageSize, string versionName, string version, string description, string createdBy, string stage) { var uri = new RawRequestUriBuilder(); @@ -915,105 +765,5 @@ public Response ListNextPage(string throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListMaterializationJobsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListMaterializationJobsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip, string filters, string featureWindowStart, string featureWindowEnd) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List materialization Jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListMaterializationJobsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List materialization Jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Continuation token for pagination. - /// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. - /// Start time of the feature window to filter materialization jobs. - /// End time of the feature window to filter materialization jobs. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMaterializationJobsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, string skip = null, string filters = null, string featureWindowStart = null, string featureWindowEnd = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - using var message = CreateListMaterializationJobsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, version, skip, filters, featureWindowStart, featureWindowEnd); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FeaturesetJobArmPaginatedResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FeaturesetJobArmPaginatedResult.DeserializeFeaturesetJobArmPaginatedResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs index 3cb7b05df7b34..305be332776e1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs @@ -32,7 +32,7 @@ public FeaturestoreEntityContainersRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs index 603c76f417e0f..199128b1f32a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs @@ -32,7 +32,7 @@ public FeaturestoreEntityVersionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs index 351c88a2e29ea..b56f1ee67a77e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs @@ -32,11 +32,11 @@ public JobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -64,22 +64,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (assetName != null) + if (properties != null) { - uri.AppendQuery("assetName", assetName, true); - } - if (scheduled != null) - { - uri.AppendQuery("scheduled", scheduled.Value, true); - } - if (scheduleId != null) - { - uri.AppendQuery("scheduleId", scheduleId, true); + uri.AppendQuery("properties", properties, true); } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -110,17 +102,9 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (assetName != null) + if (properties != null) { - uri.AppendQuery("assetName", assetName, true); - } - if (scheduled != null) - { - uri.AppendQuery("scheduled", scheduled.Value, true); - } - if (scheduleId != null) - { - uri.AppendQuery("scheduleId", scheduleId, true); + uri.AppendQuery("properties", properties, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -136,19 +120,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -172,19 +154,17 @@ public async Task> ListAsync(string /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -398,114 +378,6 @@ public Response Get(string subscriptionId, string resour } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(id, true); - 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; - } - - /// Updates a Job. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// The name and identifier for the Job. This is case-sensitive. - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MachineLearningJobData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineLearningJobData.DeserializeMachineLearningJobData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates a Job. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. - /// The name and identifier for the Job. This is case-sensitive. - /// Job definition to apply during the operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MachineLearningJobData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineLearningJobData.DeserializeMachineLearningJobData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningJobData data) { var uri = new RawRequestUriBuilder(); @@ -548,7 +420,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Creates and executes a Job. + /// + /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. @@ -582,7 +457,10 @@ public async Task> CreateOrUpdateAsync(string s } } - /// Creates and executes a Job. + /// + /// Creates and executes a Job. + /// For update case, the Tags in the definition passed in will replace Tags in the existing job. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. @@ -710,7 +588,7 @@ public Response Cancel(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -718,7 +596,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string assetName, bool? scheduled, string scheduleId) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, string jobType, string tag, MachineLearningListViewType? listViewType, string properties) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -741,20 +619,18 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -779,20 +655,18 @@ public async Task> ListNextPageAsync /// Type of job to be returned. /// Jobs returned will have this tag key. /// View type for including/excluding (for example) archived entities. - /// Asset name the job's named output is registered with. - /// Indicator whether the job is scheduled job. - /// The scheduled id for listing the job triggered from. + /// Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string assetName = null, bool? scheduled = null, string scheduleId = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, string jobType = null, string tag = null, MachineLearningListViewType? listViewType = null, string properties = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, assetName, scheduled, scheduleId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs index d99263c912a99..d389a0c83a172 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs @@ -31,7 +31,7 @@ public ManagedNetworkProvisionsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +81,7 @@ internal HttpMessage CreateProvisionManagedNetworkRequest(string subscriptionId, /// Provisions the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Managed Network Provisioning Options for a machine learning workspace. /// The cancellation token to use. /// , or is null. @@ -107,7 +107,7 @@ public async Task ProvisionManagedNetworkAsync(string subscriptionId, /// Provisions the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Managed Network Provisioning Options for a machine learning workspace. /// The cancellation token to use. /// , or is null. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs index 9e544b6fc9bc5..7aaa61bc59659 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs @@ -32,7 +32,7 @@ public ManagedNetworkSettingsRuleRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Lists the managed network outbound rules for a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +104,7 @@ public async Task> ListAsync(string subscriptio /// Lists the managed network outbound rules for a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -171,7 +171,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -199,7 +199,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -265,7 +265,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -298,7 +298,7 @@ public async Task> GetAsync(strin /// Gets an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -373,7 +373,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Creates or updates an outbound rule in the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// Outbound Rule to be created or updated in the managed network of a machine learning workspace. /// The cancellation token to use. @@ -402,7 +402,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// Creates or updates an outbound rule in the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// Outbound Rule to be created or updated in the managed network of a machine learning workspace. /// The cancellation token to use. @@ -454,7 +454,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -485,7 +485,7 @@ public async Task> ListNextPageAsync(string nex /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs new file mode 100644 index 0000000000000..c788de18a5075 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class MarketplaceSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MarketplaceSubscriptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MarketplaceSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List containers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List containers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get container. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MarketplaceSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get container. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Container name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MarketplaceSubscriptionData.DeserializeMarketplaceSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MarketplaceSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/marketplaceSubscriptions/", false); + uri.AppendPath(name, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Marketplace Subscription (asynchronous). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Marketplace Subscription name. + /// Marketplace Subscription entity to apply during operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string name, MarketplaceSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List containers. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List containers. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MarketplaceSubscriptionResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MarketplaceSubscriptionResourceArmPaginatedResult.DeserializeMarketplaceSubscriptionResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs index dd6724af0f1d4..ef9a86e6da526 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs @@ -32,7 +32,7 @@ public ModelContainersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs index 68da602751fb0..3c988c369e69e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs @@ -32,11 +32,11 @@ public ModelVersionsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -90,14 +90,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -154,10 +150,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -179,18 +171,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -221,18 +212,17 @@ public async Task> ListAsync(st /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -578,7 +568,7 @@ public Response CreateOrUpdate(string subscript } } - internal RequestUriBuilder CreatePackageRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content) + internal RequestUriBuilder CreatePublishRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -592,12 +582,12 @@ internal RequestUriBuilder CreatePackageRequestUri(string subscriptionId, string uri.AppendPath(name, true); uri.AppendPath("/versions/", false); uri.AppendPath(version, true); - uri.AppendPath("/package", false); + uri.AppendPath("/publish", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreatePackageRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content) + internal HttpMessage CreatePublishRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -614,38 +604,38 @@ internal HttpMessage CreatePackageRequest(string subscriptionId, string resource uri.AppendPath(name, true); uri.AppendPath("/versions/", false); uri.AppendPath(version, true); - uri.AppendPath("/package", false); + uri.AppendPath("/publish", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Model Version Package operation. + /// Publish version asset into registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. + /// Container name. + /// Version identifier. + /// Destination registry info. /// 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 PackageAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content, CancellationToken cancellationToken = default) + public async Task PublishAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, workspaceName, name, version, content); + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -657,26 +647,26 @@ public async Task PackageAsync(string subscriptionId, string resourceG } } - /// Model Version Package operation. + /// Publish version asset into registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. + /// Container name. + /// Version identifier. + /// Destination registry info. /// 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 Package(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, ModelPackageContent content, CancellationToken cancellationToken = default) + public Response Publish(string subscriptionId, string resourceGroupName, string workspaceName, string name, string version, DestinationAsset body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, workspaceName, name, version, content); + using var message = CreatePublishRequest(subscriptionId, resourceGroupName, workspaceName, name, version, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -688,7 +678,7 @@ public Response Package(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -696,7 +686,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip, string orderBy, int? top, string version, string description, int? offset, string tags, string properties, string feed, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -726,11 +716,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -738,7 +727,7 @@ public async Task> ListNextPage Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -770,11 +759,10 @@ public async Task> ListNextPage /// Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. /// Name of the feed. /// View type for including/excluding (for example) archived entities. - /// Model stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string name, string skip = null, string orderBy = null, int? top = null, string version = null, string description = null, int? offset = null, string tags = null, string properties = null, string feed = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -782,7 +770,7 @@ public Response ListNextPage(string next Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, properties, feed, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs index 030bdaa8c0e49..efc960363ce7b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public OnlineDeploymentsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs index 9e2e77ca77f2b..2032e2e15b54e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs @@ -32,7 +32,7 @@ public OnlineEndpointsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index a8f130fc067c2..62d77cdeab566 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Called by end-users to get all PE connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +104,7 @@ public async Task> /// Called by end-users to get all PE connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -171,7 +171,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Called by end-users to delete a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -198,7 +198,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Called by end-users to delete a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -263,7 +263,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Called by end-users to get a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -296,7 +296,7 @@ public async Task> GetAsy /// Called by end-users to get a PE connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// The cancellation token to use. /// , , or is null. @@ -374,7 +374,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 Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// PrivateEndpointConnection object. /// The cancellation token to use. @@ -410,7 +410,7 @@ public async Task> Create /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// NRP Private Endpoint Connection Name. /// PrivateEndpointConnection object. /// The cancellation token to use. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index dc7d90ece3663..e3be97d200637 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -116,7 +116,7 @@ public async Task> ListAs /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs index 72e6dfe553442..3b84970373776 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs @@ -32,7 +32,7 @@ public QuotasRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs new file mode 100644 index 0000000000000..3fbdb27bde442 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RaiPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RaiPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs new file mode 100644 index 0000000000000..2b32aab3386ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RaiPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RaiPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RaiPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + 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(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs index 43c39a9b9f2e4..74e28be3d5d39 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs @@ -32,7 +32,7 @@ public RegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs index 800792958c57d..c2b468dde977b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryCodeContainersRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs index 6163830d596e6..d2496481ed04f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs @@ -32,7 +32,7 @@ public RegistryCodeVersionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs index 9cf0a89f4891b..e4248c3771b89 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryComponentContainersRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs index 8243a35a4438f..98303bbecb47e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public RegistryComponentVersionsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -62,14 +62,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("$skip", skip, true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -98,10 +94,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("$skip", skip, true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -116,18 +108,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -151,18 +142,17 @@ public async Task> ListAsyn /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -500,7 +490,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -508,7 +498,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy, int? top, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -531,11 +521,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -543,7 +532,7 @@ public async Task> ListNext Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -568,11 +557,10 @@ public async Task> ListNext /// Ordering of list. /// Maximum number of records to return. /// Continuation token for pagination. - /// Component stage. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string componentName, string orderBy = null, int? top = null, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -580,7 +568,7 @@ public Response ListNextPage(string Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, componentName, orderBy, top, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs index 34fc255bc571c..992cbcbf1e01f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryDataContainersRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs new file mode 100644 index 0000000000000..2ad243eb61c67 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RegistryDataReferencesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RegistryDataReferencesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RegistryDataReferencesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetBlobReferenceSasRequestUri(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/datareferences/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetBlobReferenceSasRequest(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/datareferences/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + 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(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Get blob reference SAS Uri. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetBlobReferenceSasAsync(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateGetBlobReferenceSasRequest(subscriptionId, resourceGroupName, registryName, name, version, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GetBlobReferenceSasResponseDto value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GetBlobReferenceSasResponseDto.DeserializeGetBlobReferenceSasResponseDto(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get blob reference SAS Uri. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// Data reference name. + /// Version identifier. + /// Asset id and blob uri. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetBlobReferenceSas(string subscriptionId, string resourceGroupName, string registryName, string name, string version, GetBlobReferenceSasRequestDto body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateGetBlobReferenceSasRequest(subscriptionId, resourceGroupName, registryName, name, version, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GetBlobReferenceSasResponseDto value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GetBlobReferenceSasResponseDto.DeserializeGetBlobReferenceSasResponseDto(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs index d00c55d4f20c2..a27b998e9bde2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs @@ -32,7 +32,7 @@ public RegistryDataVersionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs index 1d955464e654e..98e0095504bdc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryEnvironmentContainersRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs index 5b3a476fc5b55..c032646c5d459 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs @@ -32,11 +32,11 @@ public RegistryEnvironmentVersionsRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -66,14 +66,10 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -106,10 +102,6 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("listViewType", listViewType.Value.ToString(), true); } - if (stage != null) - { - uri.AppendQuery("stage", stage, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -125,18 +117,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -161,18 +152,17 @@ public async Task> ListAs /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -510,7 +500,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -518,7 +508,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType, string stage) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy, int? top, string skip, MachineLearningListViewType? listViewType) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -542,11 +532,10 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -554,7 +543,7 @@ public async Task> ListNe Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -580,11 +569,10 @@ public async Task> ListNe /// Maximum number of records to return. /// Continuation token for pagination. /// View type for including/excluding (for example) archived entities. - /// Stage for including/excluding (for example) archived entities. Takes priority over listViewType. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, string stage = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string environmentName, string orderBy = null, int? top = null, string skip = null, MachineLearningListViewType? listViewType = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -592,7 +580,7 @@ public Response ListNextPage(strin Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, stage); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs index 492e87e089287..2478e84d6ef78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs @@ -32,7 +32,7 @@ public RegistryModelContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs index 76ec73b3e1618..fa93048ebed83 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs @@ -32,7 +32,7 @@ public RegistryModelVersionsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -540,116 +540,6 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreatePackageRequestUri(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); - uri.AppendPath(registryName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(modelName, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/package", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePackageRequest(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.MachineLearningServices/registries/", false); - uri.AppendPath(registryName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(modelName, true); - uri.AppendPath("/versions/", false); - uri.AppendPath(version, true); - uri.AppendPath("/package", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Model Version Package operation. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning registry. This is case-insensitive. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task PackageAsync(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(modelName, nameof(modelName)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, registryName, modelName, version, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Model Version Package operation. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning registry. This is case-insensitive. - /// Container name. This is case-sensitive. - /// Version identifier. This is case-sensitive. - /// Package operation request body. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Package(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, ModelPackageContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(modelName, nameof(modelName)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreatePackageRequest(subscriptionId, resourceGroupName, registryName, modelName, version, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateCreateOrGetStartPendingUploadRequestUri(string subscriptionId, string resourceGroupName, string registryName, string modelName, string version, PendingUploadRequestDto body) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs index 74f97b8a684db..14a013fc6bacc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs @@ -32,7 +32,7 @@ public SchedulesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/LabelingJobsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs similarity index 69% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/LabelingJobsRestOperations.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs index 32d859b8b396c..81413ded766a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/LabelingJobsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.MachineLearning { - internal partial class LabelingJobsRestOperations + internal partial class ServerlessEndpointsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of LabelingJobsRestOperations. + /// Initializes a new instance of ServerlessEndpointsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public LabelingJobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public ServerlessEndpointsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,20 +46,16 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs", false); + uri.AppendPath("/serverlessEndpoints", false); uri.AppendQuery("api-version", _apiVersion, true); if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -72,46 +68,41 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs", false); + uri.AppendPath("/serverlessEndpoints", false); uri.AppendQuery("api-version", _apiVersion, true); if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -119,30 +110,29 @@ public async Task> ListAsync(str } } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -150,7 +140,7 @@ public Response List(string subscriptionI } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -160,13 +150,13 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -179,8 +169,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -188,26 +178,26 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete a labeling job. + /// Delete Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -215,26 +205,26 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Delete a labeling job. + /// Delete Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -242,7 +232,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions, bool? includeLabelCategories) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -252,21 +242,13 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); - if (includeJobInstructions != null) - { - uri.AppendQuery("includeJobInstructions", includeJobInstructions.Value, true); - } - if (includeLabelCategories != null) - { - uri.AppendQuery("includeLabelCategories", includeLabelCategories.Value, true); - } return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions, bool? includeLabelCategories) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -279,94 +261,82 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); - if (includeJobInstructions != null) - { - uri.AppendQuery("includeJobInstructions", includeJobInstructions.Value, true); - } - if (includeLabelCategories != null) - { - uri.AppendQuery("includeLabelCategories", includeLabelCategories.Value, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets a labeling job by name/id. + /// Get Serverless Endpoint. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MachineLearningLabelingJobData value = default; + ServerlessEndpointData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); + value = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MachineLearningLabelingJobData)null, message.Response); + return Response.FromValue((ServerlessEndpointData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a labeling job by name/id. + /// Get Serverless Endpoint. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// Boolean value to indicate whether to include JobInstructions in response. - /// Boolean value to indicate Whether to include LabelCategories in response. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, id, includeJobInstructions, includeLabelCategories); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MachineLearningLabelingJobData value = default; + ServerlessEndpointData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineLearningLabelingJobData.DeserializeMachineLearningLabelingJobData(document.RootElement); + value = ServerlessEndpointData.DeserializeServerlessEndpointData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MachineLearningLabelingJobData)null, message.Response); + return Response.FromValue((ServerlessEndpointData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -376,17 +346,17 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -395,78 +365,78 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); 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(data, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Creates or updates a labeling job (asynchronous). + /// Update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// LabelingJob definition object. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, data); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Creates or updates a labeling job (asynchronous). + /// Update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// LabelingJob definition object. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string id, MachineLearningLabelingJobData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, id, data); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateExportLabelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -476,18 +446,17 @@ internal RequestUriBuilder CreateExportLabelsRequestUri(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/exportLabels", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateExportLabelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -496,79 +465,78 @@ internal HttpMessage CreateExportLabelsRequest(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/exportLabels", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); 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(body, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Export labels from a labeling job (asynchronous). + /// Create or update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// The export summary. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ExportLabelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateExportLabelsRequest(subscriptionId, resourceGroupName, workspaceName, id, body); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Export labels from a labeling job (asynchronous). + /// Create or update Serverless Endpoint (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. - /// The export summary. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ExportLabels(string subscriptionId, string resourceGroupName, string workspaceName, string id, ExportSummary body, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateExportLabelsRequest(subscriptionId, resourceGroupName, workspaceName, id, body); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, name, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal RequestUriBuilder CreateListKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -578,14 +546,14 @@ internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/pause", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -598,9 +566,9 @@ internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGr uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/pause", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -608,59 +576,69 @@ internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGr return message; } - /// Pause a labeling job. + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task PauseAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - return message.Response; + { + MachineLearningEndpointAuthKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Pause a labeling job. + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Pause(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - return message.Response; + { + MachineLearningEndpointAuthKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningEndpointAuthKeys.DeserializeMachineLearningEndpointAuthKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -670,14 +648,14 @@ internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/resume", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/regenerateKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string workspaceName, string id) + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -690,32 +668,38 @@ internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); - uri.AppendPath("/labelingJobs/", false); - uri.AppendPath(id, true); - uri.AppendPath("/resume", false); + uri.AppendPath("/serverlessEndpoints/", false); + uri.AppendPath(name, true); + uri.AppendPath("/regenerateKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Resume a labeling job (asynchronous). + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. + /// RegenerateKeys request . /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ResumeAsync(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, name, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -727,22 +711,24 @@ public async Task ResumeAsync(string subscriptionId, string resourceGr } } - /// Resume a labeling job (asynchronous). + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. - /// The name and identifier for the LabelingJob. + /// Serverless Endpoint name. + /// RegenerateKeys request . /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Resume(string subscriptionId, string resourceGroupName, string workspaceName, string id, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string workspaceName, string name, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, workspaceName, id); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, name, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -754,7 +740,7 @@ public Response Resume(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -762,7 +748,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip, int? top) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -776,32 +762,31 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -809,32 +794,31 @@ public async Task> ListNextPageA } } - /// Lists labeling jobs in the workspace. + /// List Serverless Endpoints. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Continuation token for pagination. - /// Number of labeling jobs to return. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, int? top = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip, top); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, skip); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - LabelingJobResourceArmPaginatedResult value = default; + ServerlessEndpointTrackedResourceArmPaginatedResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LabelingJobResourceArmPaginatedResult.DeserializeLabelingJobResourceArmPaginatedResult(document.RootElement); + value = ServerlessEndpointTrackedResourceArmPaginatedResult.DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs index 5b1d8418dce06..9e87eb46a663c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs @@ -32,7 +32,7 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs index 2476225f33a42..003f864f03c22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineSizesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs index 972a85252305a..a10bb2895787a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs @@ -32,11 +32,11 @@ public WorkspaceConnectionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -56,10 +56,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendQuery("category", category, true); } uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -82,6 +86,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendQuery("category", category, true); } uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -91,19 +99,20 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Lists all the available machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -122,19 +131,20 @@ public async Task Lists all the available machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -191,7 +201,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Delete machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -218,7 +228,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Delete machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -283,7 +293,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Lists machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -316,7 +326,7 @@ public async Task> GetAsync(str /// Lists machine learning workspaces connections by name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -391,7 +401,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// Parameters for workspace connection update. /// The cancellation token to use. @@ -424,7 +434,7 @@ public async Task> UpdateAsync( /// Update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// Parameters for workspace connection update. /// The cancellation token to use. @@ -499,7 +509,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// Create or update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The object for creating or updating a new workspace connection. /// The cancellation token to use. @@ -532,7 +542,7 @@ public async Task> CreateAsync( /// Create or update machine learning workspaces connections under the specified workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The object for creating or updating a new workspace connection. /// The cancellation token to use. @@ -605,7 +615,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso /// List all the secrets of a machine learning workspaces connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -636,7 +646,7 @@ public async Task> ListSecretsA /// List all the secrets of a machine learning workspaces connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -664,7 +674,108 @@ public Response ListSecrets(string subsc } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal RequestUriBuilder CreateTestConnectionRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/testconnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateTestConnectionRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/testconnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (data != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Test machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Workspace Connection object. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task TestConnectionAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateTestConnectionRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Test machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Workspace Connection object. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response TestConnection(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateTestConnectionRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -672,7 +783,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -690,20 +801,21 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -723,20 +835,21 @@ public async Task The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs index 53e88eeacd5d8..254f7a0408cba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs @@ -32,7 +32,7 @@ public WorkspaceFeaturesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs index 13c5281c7046b..ae26b9fc03302 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs @@ -32,11 +32,11 @@ public WorkspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string skip, string kind) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,18 +44,22 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string skip, string kind) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -66,13 +70,17 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -82,16 +90,17 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri /// Lists all the available machine learning workspaces under the specified subscription. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionAsync(string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId, skip, kind); + using var message = CreateListBySubscriptionRequest(subscriptionId, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -109,16 +118,17 @@ public async Task> ListBySubscriptionAsync(string /// Lists all the available machine learning workspaces under the specified subscription. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListBySubscription(string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId, skip, kind); + using var message = CreateListBySubscriptionRequest(subscriptionId, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -134,7 +144,7 @@ public Response ListBySubscription(string subscriptionId, s } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string skip, string kind) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -144,18 +154,22 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string skip, string kind) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -168,13 +182,17 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } if (skip != null) { uri.AppendQuery("$skip", skip, true); } - if (kind != null) + if (aiCapabilities != null) { - uri.AppendQuery("kind", kind, true); + uri.AppendQuery("aiCapabilities", aiCapabilities, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -185,17 +203,18 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str /// Lists all the available machine learning workspaces under the specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -214,17 +233,18 @@ public async Task> ListByResourceGroupAsync(string /// Lists all the available machine learning workspaces under the specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -285,7 +305,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Flag to indicate delete is a purge request. /// The cancellation token to use. /// , or is null. @@ -312,7 +332,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Flag to indicate delete is a purge request. /// The cancellation token to use. /// , or is null. @@ -373,7 +393,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets the properties of the specified machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -404,7 +424,7 @@ public async Task> GetAsync(string subscr /// Gets the properties of the specified machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -473,7 +493,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Updates a machine learning workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -500,7 +520,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// Updates a machine learning workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -565,7 +585,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Creates or updates a workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -592,7 +612,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// Creates or updates a workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -662,7 +682,7 @@ internal HttpMessage CreateDiagnoseRequest(string subscriptionId, string resourc /// Diagnose workspace setup issue. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameter of diagnosing workspace health. /// The cancellation token to use. /// , or is null. @@ -688,7 +708,7 @@ public async Task DiagnoseAsync(string subscriptionId, string resource /// Diagnose workspace setup issue. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameter of diagnosing workspace health. /// The cancellation token to use. /// , or is null. @@ -750,7 +770,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -779,7 +799,7 @@ public async Task> ListKeysAsync /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -844,7 +864,7 @@ internal HttpMessage CreateListNotebookAccessTokenRequest(string subscriptionId, /// Get Azure Machine Learning Workspace notebook access token. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -873,7 +893,7 @@ public async Task> L /// Get Azure Machine Learning Workspace notebook access token. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -938,7 +958,7 @@ internal HttpMessage CreateListNotebookKeysRequest(string subscriptionId, string /// Lists keys of Azure Machine Learning Workspaces notebook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -967,7 +987,7 @@ public async Task> ListN /// Lists keys of Azure Machine Learning Workspaces notebook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1032,7 +1052,7 @@ internal HttpMessage CreateListStorageAccountKeysRequest(string subscriptionId, /// Lists keys of Azure Machine Learning Workspace's storage account. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1061,7 +1081,7 @@ public async Task> /// Lists keys of Azure Machine Learning Workspace's storage account. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1126,7 +1146,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(strin /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1155,7 +1175,7 @@ public async Task> ListOutboundNetworkDependencie /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1220,7 +1240,7 @@ internal HttpMessage CreatePrepareNotebookRequest(string subscriptionId, string /// Prepare Azure Machine Learning Workspace's notebook resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1245,7 +1265,7 @@ public async Task PrepareNotebookAsync(string subscriptionId, string r /// Prepare Azure Machine Learning Workspace's notebook resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1306,7 +1326,7 @@ internal HttpMessage CreateResyncKeysRequest(string subscriptionId, string resou /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1331,7 +1351,7 @@ public async Task ResyncKeysAsync(string subscriptionId, string resour /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1353,7 +1373,7 @@ public Response ResyncKeys(string subscriptionId, string resourceGroupName, stri } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string skip, string kind) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1361,7 +1381,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string skip, string kind) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1378,17 +1398,18 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Lists all the available machine learning workspaces under the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skip, kind); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1407,17 +1428,18 @@ public async Task> ListBySubscriptionNextPageAsync /// Lists all the available machine learning workspaces under the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skip, kind); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1433,7 +1455,7 @@ public Response ListBySubscriptionNextPage(string nextLink, } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string skip, string kind) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1441,7 +1463,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string skip, string kind) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1459,18 +1481,19 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, kind, skip, aiCapabilities); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1490,18 +1513,19 @@ public async Task> ListByResourceGroupNextPageAsyn /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Continuation token for pagination. /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string skip = null, string kind = null, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, kind); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, kind, skip, aiCapabilities); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs new file mode 100644 index 0000000000000..5a3ba1b9c8e3b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetServerlessEndpoints method from an instance of . + /// + public partial class ServerlessEndpointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serverlessEndpointClientDiagnostics; + private readonly ServerlessEndpointsRestOperations _serverlessEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected ServerlessEndpointCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ServerlessEndpointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serverlessEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ServerlessEndpointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServerlessEndpointResource.ResourceType, out string serverlessEndpointApiVersion); + _serverlessEndpointRestClient = new ServerlessEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverlessEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint name. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, ServerlessEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Get"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Get"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Serverless Endpoints. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints + /// + /// + /// Operation Id + /// ServerlessEndpoints_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serverlessEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serverlessEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServerlessEndpointResource(Client, ServerlessEndpointData.DeserializeServerlessEndpointData(e)), _serverlessEndpointClientDiagnostics, Pipeline, "ServerlessEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Serverless Endpoints. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints + /// + /// + /// Operation Id + /// ServerlessEndpoints_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serverlessEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serverlessEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServerlessEndpointResource(Client, ServerlessEndpointData.DeserializeServerlessEndpointData(e)), _serverlessEndpointClientDiagnostics, Pipeline, "ServerlessEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Exists"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.Exists"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs new file mode 100644 index 0000000000000..444cfb0c53f8c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class ServerlessEndpointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointData(document.RootElement, options); + } + + internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + string kind = default; + ServerlessEndpointProperties properties = default; + MachineLearningSku sku = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + properties = ServerlessEndpointProperties.DeserializeServerlessEndpointProperties(property.Value, options); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = MachineLearningSku.DeserializeMachineLearningSku(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + identity, + kind, + properties, + sku, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs new file mode 100644 index 0000000000000..28072f92ba5d0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the ServerlessEndpoint data model. + public partial class ServerlessEndpointData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + /// [Required] Additional attributes of the entity. + /// is null. + public ServerlessEndpointData(AzureLocation location, ServerlessEndpointProperties properties) : base(location) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. + /// Sku details required for ARM contract for Autoscaling. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, ServerlessEndpointProperties properties, MachineLearningSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Identity = identity; + Kind = kind; + Properties = properties; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointData() + { + } + + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + public string Kind { get; set; } + /// [Required] Additional attributes of the entity. + public ServerlessEndpointProperties Properties { get; set; } + /// Sku details required for ARM contract for Autoscaling. + public MachineLearningSku Sku { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs new file mode 100644 index 0000000000000..b04a2e28ef133 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class ServerlessEndpointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ServerlessEndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ServerlessEndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs new file mode 100644 index 0000000000000..0587ec53be670 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs @@ -0,0 +1,875 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a ServerlessEndpoint along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetServerlessEndpointResource method. + /// Otherwise you can get one from its parent resource using the GetServerlessEndpoint method. + /// + public partial class ServerlessEndpointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _serverlessEndpointClientDiagnostics; + private readonly ServerlessEndpointsRestOperations _serverlessEndpointRestClient; + private readonly ServerlessEndpointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/serverlessEndpoints"; + + /// Initializes a new instance of the class for mocking. + protected ServerlessEndpointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServerlessEndpointResource(ArmClient client, ServerlessEndpointData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ServerlessEndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serverlessEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serverlessEndpointApiVersion); + _serverlessEndpointRestClient = new ServerlessEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverlessEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ServerlessEndpointData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Get"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Get"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerlessEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Delete"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Delete"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Update"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Serverless Endpoint (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Serverless Endpoint entity to apply during operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ServerlessEndpointPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.Update"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new MachineLearningArmOperation(new ServerlessEndpointOperationSource(Client), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.GetKeys"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List EndpointAuthKeys for an Endpoint using Key-based authentication. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeys(CancellationToken cancellationToken = default) + { + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.GetKeys"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// RegenerateKeys request . + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeysAsync(WaitUntil waitUntil, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RegenerateKeys"); + scope.Start(); + try + { + var response = await _serverlessEndpointRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MachineLearningEndpointAuthKeysOperationSource(), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateRegenerateKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys + /// + /// + /// Operation Id + /// ServerlessEndpoints_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// RegenerateKeys request . + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RegenerateKeys(WaitUntil waitUntil, MachineLearningEndpointKeyRegenerateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RegenerateKeys"); + scope.Start(); + try + { + var response = _serverlessEndpointRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MachineLearningArmOperation(new MachineLearningEndpointAuthKeysOperationSource(), _serverlessEndpointClientDiagnostics, Pipeline, _serverlessEndpointRestClient.CreateRegenerateKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ServerlessEndpointPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ServerlessEndpointPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _serverlessEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _serverlessEndpointClientDiagnostics.CreateScope("ServerlessEndpointResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _serverlessEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ServerlessEndpointResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ServerlessEndpointPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs new file mode 100644 index 0000000000000..a57bf264faee3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceConnectionDeployments method from an instance of . + /// + public partial class WorkspaceConnectionDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionDeploymentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceConnectionDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the deployments under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments + /// + /// + /// Operation Id + /// Connection_ListDeployments + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "WorkspaceConnectionDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments + /// + /// + /// Operation Id + /// Connection_ListDeployments + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "WorkspaceConnectionDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs new file mode 100644 index 0000000000000..eb8d86503665f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceConnectionDeploymentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs new file mode 100644 index 0000000000000..3857dcd15e80b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceConnectionDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceConnectionDeploymentResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceConnectionDeployment method. + /// + public partial class WorkspaceConnectionDeploymentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + private readonly EndpointDeploymentResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/deployments"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionDeploymentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceConnectionDeploymentResource(ArmClient client, EndpointDeploymentResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceConnectionDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointDeploymentResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Azure OpenAI connection deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_DeleteDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.DeleteDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateDeleteDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Azure OpenAI connection deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_DeleteDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Delete"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.DeleteDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateDeleteDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Update"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Update"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs new file mode 100644 index 0000000000000..19a6e857d11d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceConnectionRaiPolicies method from an instance of . + /// + public partial class WorkspaceConnectionRaiPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics; + private readonly ConnectionRaiPolicyRestOperations _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient; + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics; + private readonly ConnectionRaiPoliciesRestOperations _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionRaiPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionRaiPolicyResource.ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient = new ConnectionRaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionRaiPolicyResource.ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPoliciesApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient = new ConnectionRaiPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPoliciesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies + /// + /// + /// Operation Id + /// ConnectionRaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceConnectionRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies + /// + /// + /// Operation Id + /// ConnectionRaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceConnectionRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs new file mode 100644 index 0000000000000..792d7e587363d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceConnectionRaiPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs new file mode 100644 index 0000000000000..24573838500d4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceConnectionRaiPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceConnectionRaiPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceConnectionRaiPolicy method. + /// + public partial class WorkspaceConnectionRaiPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics; + private readonly ConnectionRaiPolicyRestOperations _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient; + private readonly RaiPolicyPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiPolicies"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionRaiPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyResource(ArmClient client, RaiPolicyPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient = new ConnectionRaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiPolicyPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs new file mode 100644 index 0000000000000..f6fd71f1f7b08 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceEndpointDeployments method from an instance of . + /// + public partial class WorkspaceEndpointDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointDeploymentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceEndpointDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointDeploymentResource.ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResourcePropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResourcePropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the deployments under the endpoint resource scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "WorkspaceEndpointDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the endpoint resource scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "WorkspaceEndpointDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs new file mode 100644 index 0000000000000..1594ecc8954dc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceEndpointDeploymentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs new file mode 100644 index 0000000000000..54b5548216a09 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceEndpointDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceEndpointDeploymentResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceEndpointDeployment method. + /// + public partial class WorkspaceEndpointDeploymentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; + private readonly EndpointDeploymentResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints/deployments"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointDeploymentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceEndpointDeploymentResource(ArmClient client, EndpointDeploymentResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceEndpointDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointDeploymentResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete endpoint deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete endpoint deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Delete"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Update"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Update"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs new file mode 100644 index 0000000000000..c8f36b19acf43 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceEndpointRaiPolicies method from an instance of . + /// + public partial class WorkspaceEndpointRaiPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics; + private readonly RaiPolicyRestOperations _workspaceEndpointRaiPolicyRaiPolicyRestClient; + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics; + private readonly RaiPoliciesRestOperations _workspaceEndpointRaiPolicyRaiPoliciesRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointRaiPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointRaiPolicyResource.ResourceType, out string workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPolicyRestClient = new RaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointRaiPolicyResource.ResourceType, out string workspaceEndpointRaiPolicyRaiPoliciesApiVersion); + _workspaceEndpointRaiPolicyRaiPoliciesRestClient = new RaiPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPoliciesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResourcePropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResourcePropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies + /// + /// + /// Operation Id + /// RaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceEndpointRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies + /// + /// + /// Operation Id + /// RaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceEndpointRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs new file mode 100644 index 0000000000000..5e26b0d44537b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceEndpointRaiPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs new file mode 100644 index 0000000000000..3a5d56f221251 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceEndpointRaiPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceEndpointRaiPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceEndpointRaiPolicy method. + /// + public partial class WorkspaceEndpointRaiPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + /// The raiPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics; + private readonly RaiPolicyRestOperations _workspaceEndpointRaiPolicyRaiPolicyRestClient; + private readonly RaiPolicyPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints/raiPolicies"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointRaiPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyResource(ArmClient client, RaiPolicyPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPolicyRestClient = new RaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiPolicyPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md index f49ad948300d0..0df1ca468255a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: MachineLearning namespace: Azure.ResourceManager.MachineLearning -require: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/machinelearningservices/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/edb7904bfead536c7aa9716d44dba15bdabd0b00/specification/machinelearningservices/resource-manager/readme.md #tag: package-preview-2023-06 output-folder: $(this-folder)/Generated clear-output-folder: true